* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color: #333; }
.home-page, .gradient-page { min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.home-page { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; }
.navbar-custom { background: rgba(255,255,255,.95); padding: 15px 30px; position: fixed; top: 0; width: 100%; box-shadow: 0 2px 10px rgba(0,0,0,.1); z-index: 1000; }
.navbar-brand { color: #667eea !important; font-weight: bold; font-size: 24px; }
.login-btn { background: #667eea; color: #fff; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.login-btn:hover { background: #5568d3; color: #fff; text-decoration: none; }
.container-main { margin-top: 80px; max-width: 900px; background: #fff; border-radius: 15px; padding: 50px; box-shadow: 0 10px 40px rgba(0,0,0,.2); text-align: center; }
.home-container .header { margin-bottom: 50px; }
.home-container .header h1 { font-size: 48px; color: #667eea; font-weight: bold; margin-bottom: 10px; }
.home-container .header p { font-size: 18px; color: #666; }
.options-container { display: grid; grid-template-columns: repeat(3,1fr); gap: 30px; margin-top: 40px; }
.option-card { background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); padding: 40px; border-radius: 15px; text-align: center; color: #fff; transition: transform .3s, box-shadow .3s; text-decoration: none; display: flex; flex-direction: column; justify-content: center; min-height: 300px; }
.option-card:hover { transform: translateY(-10px); box-shadow: 0 15px 40px rgba(102,126,234,.4); color: #fff; text-decoration: none; }
.option-card.secondary { background: linear-gradient(135deg,#10b981 0%,#059669 100%); }
.option-card.tertiary { background: linear-gradient(135deg,#f59e0b 0%,#d97706 100%); }
.option-icon { font-size: 60px; margin-bottom: 20px; }
.option-title { font-size: 28px; font-weight: bold; margin-bottom: 15px; }
.option-description { font-size: 14px; opacity: .9; line-height: 1.6; }

.gradient-page { display: flex; justify-content: center; align-items: center; padding: 20px; }
.legacy-panel { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.2); width: 100%; max-width: calc(100vw - 40px); min-width: 0; overflow: hidden; }
.account-container { max-width: min(520px,calc(100vw - 40px)); }
.login-container { max-width: min(450px,calc(100vw - 40px)); }
.panel-header { text-align: center; padding: 42px 25px; background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); color: #fff; }
.panel-header h1 { font-size: 34px; font-weight: 700; margin: 8px 0; }
.panel-header p { margin: 0; font-size: 14px; opacity: .95; }
.header-icon { font-size: 42px; }
.panel-content { padding: 36px; }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; color: #1f2937; font-weight: 600; margin-bottom: 9px; font-size: 14px; }
.form-group label i { margin-right: 7px; color: #667eea; width: 18px; text-align: center; }
.form-group label span { color: #ef4444; }
.form-control { border-radius: 9px; border: 1.5px solid #e5e7eb; padding: 12px 15px; height: 48px; background: #f9fafb; }
select.form-control { height: 48px; }
.form-control:focus { border-color: #667eea; box-shadow: 0 0 0 .2rem rgba(102,126,234,.2); background: #fff; }
.btn-submit, .btn-search, .btn-primary-legacy { border: 0; background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); color: #fff; padding: 12px 20px; border-radius: 8px; font-weight: 600; width: 100%; }
.btn-submit:hover, .btn-search:hover, .btn-primary-legacy:hover { color: #fff; transform: translateY(-1px); }
button:disabled { opacity: .65; cursor: wait; }
.home-link { text-align: center; margin-top: 22px; }
.home-link a { color: #667eea; font-weight: 600; text-decoration: none; }
.role-buttons { display: flex; gap: 10px; }
.btn-role { flex: 1; background: #e5e7eb; color: #374151; border: 2px solid #d1d5db; padding: 12px 20px; border-radius: 8px; cursor: pointer; }
.btn-role.active { background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); color: #fff; border-color: #764ba2; box-shadow: 0 4px 12px rgba(102,126,234,.3); }
.demo-credentials { background: #e0e7ff; padding: 12px; border-radius: 8px; margin-top: 20px; font-size: 12px; color: #3730a3; border-left: 4px solid #667eea; }
.demo-credentials p { margin: 4px 0; }
.error-message, .success-message { padding: 13px; border-radius: 8px; margin-bottom: 20px; font-size: 13px; border-left: 4px solid; }
.error-message { color: #991b1b; background: #fee2e2; border-color: #ef4444; }
.success-message { color: #065f46; background: #d1fae5; border-color: #10b981; }
.registration-success { text-align: center; }
.registration-success img { width: 210px; height: 210px; border: 8px solid #f3f4f6; border-radius: 12px; margin: 16px auto; display: block; }
.registration-success h2 { color: #10b981; font-weight: 700; }
.issued-id { padding: 12px; background: #eef2ff; border-radius: 8px; color: #3730a3; font-size: 18px; font-weight: 700; }
.success-actions { display: grid; gap: 10px; margin-top: 18px; }
.success-actions a { padding: 11px; border-radius: 8px; color: #fff; background: #667eea; text-decoration: none; font-weight: 600; }

.portal-page { min-height: 100vh; background: #f5f7fa; padding-top: 76px; }
.legacy-navbar { position: fixed; z-index: 1000; top: 0; left: 0; right: 0; min-height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 12px 28px; background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.legacy-navbar .navbar-brand { color: #fff !important; }
.legacy-navbar a { color: #fff; display: inline-block; padding: 8px 12px; text-decoration: none; }
.page-shell { width: min(1100px,calc(100% - 32px)); margin: 28px auto 60px; }
.wide-shell { max-width: 1200px; }
.tracking-shell { max-width: 900px; }
.legacy-card { background: #fff; border-radius: 15px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.legacy-card h3 { color: #667eea; font-weight: 700; margin-bottom: 10px; }
.scanner-card { max-width: 680px; margin: 30px auto; text-align: center; }
.video-frame { width: 100%; max-width: 520px; aspect-ratio: 4/3; position: relative; overflow: hidden; margin: 18px auto; border-radius: 12px; background: #111827; }
.video-frame.compact { max-width: 430px; }
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 15%; border: 3px solid #667eea; border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.32); }
.scanner-status { color: #667eea; font-size: 14px; margin: 10px 0; }
.manual-lookup { border-top: 1px solid #e5e7eb; margin-top: 20px; padding-top: 18px; color: #777; }
.manual-lookup form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.manual-lookup .btn-primary-legacy { width: auto; white-space: nowrap; }
.purchase-workspace { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.profile-panel { text-align: center; }
.profile-avatar { width: 92px; height: 92px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; font-size: 38px; }
.profile-row { display: flex; gap: 12px; text-align: left; padding: 12px 0; border-bottom: 1px solid #eee; color: #555; }
.profile-row i { color: #667eea; width: 20px; }
.points-box { margin: 20px 0; padding: 16px; border-radius: 10px; background: #fef3c7; color: #92400e; display: flex; justify-content: space-between; }
.btn-secondary-legacy { width: 100%; padding: 11px; border: 1px solid #667eea; border-radius: 8px; background: #fff; color: #667eea; font-weight: 600; }
.water-type-grid { display: flex; gap: 10px; }
.water-type { flex: 1; padding: 13px; border: 2px solid #d1d5db; border-radius: 9px; background: #fff; color: #555; }
.water-type.active { color: #fff; border-color: #667eea; background: linear-gradient(135deg,#667eea,#764ba2); }
.price-breakdown { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; margin-bottom: 22px; }
.price-breakdown > div { display: flex; justify-content: space-between; padding: 7px 0; }
.price-breakdown .total-row { margin-top: 7px; border-top: 2px solid #667eea; color: #667eea; font-size: 18px; }
.change-display { margin-top: 10px; padding: 11px; background: #d1fae5; color: #065f46; border-radius: 8px; text-align: right; }
.receipt { border: 2px dashed #9ca3af; padding: 22px; background: #fff; }
.receipt h3 { text-align: center; }
.receipt-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #ddd; }
.receipt .receipt-total { font-size: 19px; font-weight: 700; color: #667eea; }

.search-container { max-width: 680px; margin: 30px auto 22px; }
.tab-buttons { display: flex; gap: 10px; margin: 20px 0; border-bottom: 2px solid #f0f0f0; }
.tab-btn { flex: 1; border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 12px; color: #777; font-weight: 600; }
.tab-btn.active { color: #667eea; border-bottom-color: #667eea; }
.track-tab:not(.active) { display: none; }
.transaction-card { background: #fff; border-radius: 15px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.transaction-header { display: flex; justify-content: space-between; align-items: start; gap: 15px; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 15px; }
.transaction-id { font-size: 18px; color: #667eea; font-weight: 700; }
.transaction-date { color: #777; font-size: 13px; }
.status-badge { padding: 7px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.status-pending { background: #fef3c7; color: #92400e; }.status-approved { background: #d1fae5; color: #065f46; }.status-denied { background: #fee2e2; color: #7f1d1d; }
.transaction-details { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; }
.detail-label { color: #666; }.detail-value { text-align: right; font-weight: 600; }
.delivery-status { margin-top: 16px; padding: 18px; border-radius: 10px; text-align: center; color: #fff; background: #3b82f6; }
.delivery-status.delivered { background: #10b981; }.delivery-status.pending { background: #f59e0b; }
.status-icon { font-size: 30px; }.status-title { font-size: 18px; font-weight: 700; }
.timeline { padding: 20px 0 0; }.timeline-item { display: flex; gap: 14px; margin-bottom: 18px; }.timeline-marker { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: 0 0 40px; background: #d1d5db; }.timeline-marker.completed { background: #10b981; }.timeline-marker.active { background: #3b82f6; }.timeline-content h6 { margin: 0; font-weight: 600; }.timeline-content p { margin: 4px 0 0; color: #777; font-size: 13px; }
.no-transactions { background: #fff; border-radius: 15px; padding: 45px; text-align: center; color: #999; max-width: 680px; margin: 20px auto; box-shadow: 0 4px 20px rgba(0,0,0,.08); }.no-transactions i { font-size: 48px; color: #ddd; margin-bottom: 15px; }

.legacy-dashboard { margin: 0; min-height: 100vh; background: #f5f7fa; color: #333; }
.dashboard-navbar { min-height: 66px; padding: 12px 24px; background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.dashboard-navbar .navbar-brand { font-size: 24px; font-weight: 700; }
.dashboard-user { display: flex; align-items: center; gap: 20px; color: #fff; }
.logout-btn { border: 0; border-radius: 5px; background: #ef4444; color: #fff; padding: 8px 15px; font-size: 14px; }
.dashboard-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: calc(100vh - 66px); }
.dashboard-sidebar { background: #fff; padding: 20px; box-shadow: 2px 0 5px rgba(0,0,0,.08); }
.sidebar-menu { list-style: none; margin: 0; padding: 0; }
.sidebar-menu li { margin: 10px 0; }
.sidebar-menu a { display: block; border-radius: 5px; padding: 10px 15px; color: #333; text-decoration: none; transition: .2s; }
.sidebar-menu a:hover,.sidebar-menu a.active { background: #667eea; color: #fff; }
.dashboard-content { min-width: 0; padding: 30px; }
.dashboard-heading { margin-bottom: 30px; }
.dashboard-heading h2 { margin-bottom: 10px; font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.dashboard-stat { min-height: 122px; margin-bottom: 20px; border-left: 4px solid #667eea; border-radius: 10px; background: #fff; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.dashboard-stat.sales,.dashboard-stat.approved { border-left-color: #10b981; }.dashboard-stat.pending { border-left-color: #f59e0b; }.dashboard-stat.denied { border-left-color: #ef4444; }
.dashboard-stat h6 { margin: 0 0 10px; color: #666; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.dashboard-stat .value { font-size: 28px; font-weight: 700; }.dashboard-stat .icon { float: right; color: #667eea; font-size: 30px; }.dashboard-stat.sales .icon,.dashboard-stat.approved .icon { color: #10b981; }.dashboard-stat.pending .icon { color: #f59e0b; }.dashboard-stat.denied .icon { color: #ef4444; }
.dashboard-table-card { margin-bottom: 20px; border-radius: 10px; background: #fff; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.dashboard-table-card h5 { margin-bottom: 20px; }.dashboard-table-card .table { margin-bottom: 0; }.dashboard-table-card th { white-space: nowrap; }
.badge-pending,.badge-approved,.badge-denied { display: inline-block; border-radius: 20px; padding: 5px 10px; font-size: 12px; font-weight: 600; text-transform: capitalize; }.badge-pending { background:#fef3c7;color:#92400e }.badge-approved { background:#d1fae5;color:#065f46 }.badge-denied { background:#fee2e2;color:#7f1d1d }
.table-actions { display: flex; gap: 5px; }.table-action { border: 0; border-radius: 4px; color: #fff; padding: 5px 10px; font-size: 12px; }.table-action.approve { background:#10b981 }.table-action.deny { background:#ef4444 }

@media (max-width: 768px) {
  .options-container { grid-template-columns: 1fr; }.container-main { padding: 30px; }.home-container .header h1 { font-size: 36px; }.navbar-custom { padding: 10px 20px; }
  .panel-content { padding: 26px 22px; }.panel-header { padding: 34px 20px; }.panel-header h1 { font-size: 29px; overflow-wrap: anywhere; }
  .legacy-navbar { position: static; flex-direction: column; gap: 5px; text-align: center; }.legacy-navbar a { font-size: 13px; padding: 6px; }.portal-page { padding-top: 0; }
  .purchase-workspace { grid-template-columns: 1fr; }.water-type-grid { flex-direction: column; }.manual-lookup form { grid-template-columns: 1fr; }.manual-lookup .btn-primary-legacy { width: 100%; }
  .transaction-details { align-items: start; }.transaction-header { flex-direction: column; }.page-shell { width: min(100% - 22px,1100px); }
  .dashboard-navbar { align-items: flex-start; gap: 12px; }.dashboard-user { width: 100%; justify-content: space-between; }.dashboard-layout { grid-template-columns: 1fr; }.dashboard-sidebar { padding: 8px 14px; }.sidebar-menu { display: flex; gap: 5px; overflow-x: auto; }.sidebar-menu li { flex: 0 0 auto; }.dashboard-content { padding: 22px 14px; }.stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; }.dashboard-navbar .navbar-brand { font-size: 20px; }.dashboard-user { font-size: 13px; } }
