/* ============================================================
   ENRICH WATER MANAGEMENT SYSTEM — Main Stylesheet
   Palette: Deep Water Navy | Clean White | Fresh Teal | Alert Orange
   ============================================================ */

:root {
  --navy:   #0A1628;
  --navy-mid: #132240;
  --teal:   #0EA5B0;
  --teal-light: #5FD3DA;
  --white:  #FFFFFF;
  --off-white: #F4F7FA;
  --slate:  #64748B;
  --border: #E2E8F0;
  --success:#16A34A;
  --warning:#D97706;
  --danger: #DC2626;
  --text:   #1E293B;
  --sidebar-w: 255px;
  --radius: 10px;
  --shadow: 0 2px 16px rgba(10,22,40,0.08);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--off-white);
  color: var(--text);
  margin: 0; font-size: 15px; line-height: 1.6;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--navy); }

/* === SIDEBAR === */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #B8C8D8;
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
  transition: transform 0.25s ease;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand .brand-logo {
  display: flex; align-items: center; gap: 10px;
}
.brand-icon {
  width: 36px; height: 36px; background: var(--teal);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.brand-name { font-size: 13px; font-weight: 700; color: var(--white); line-height: 1.2; }
.brand-sub { font-size: 10px; color: var(--teal-light); text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar-section { padding: 16px 12px 4px; }
.sidebar-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: #4A6080; font-weight: 600; padding: 0 8px; margin-bottom: 4px;
}
.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li { margin-bottom: 1px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: 7px;
  color: #8FAABF; font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(14,165,176,0.12); color: var(--teal-light);
}
.sidebar-nav a .nav-icon { font-size: 15px; width: 18px; text-align: center; }
.sidebar-footer {
  margin-top: auto; padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: #8FAABF;
}
.user-avatar {
  width: 32px; height: 32px; background: var(--teal);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: white; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}

/* === MAIN LAYOUT === */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--navy); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-body { padding: 24px; flex: 1; }

/* === CARDS === */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--navy); margin: 0; }
.card-body { padding: 20px; }

/* === STAT CARDS === */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--teal);
  position: relative;
}
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger  { border-left-color: var(--danger); }
.stat-card.success { border-left-color: var(--success); }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--slate); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy); margin: 4px 0 2px; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--slate); }
.stat-icon { position: absolute; top: 18px; right: 16px; font-size: 24px; opacity: 0.12; }

/* === TABLES === */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  background: var(--off-white); color: var(--slate);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #F8FAFB; }

/* === BADGES / STATUS === */
.badge {
  display: inline-block; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: #DBEAFE; color: #1D4ED8; }
.badge-secondary { background: #F1F5F9; color: #475569; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; border: none;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  text-decoration: none;
}
.btn-primary   { background: var(--teal); color: white; }
.btn-primary:hover { background: #0994A0; color: white; }
.btn-navy      { background: var(--navy); color: white; }
.btn-navy:hover { background: var(--navy-mid); color: white; }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-danger    { background: var(--danger); color: white; }
.btn-success   { background: var(--success); color: white; }
.btn-warning   { background: var(--warning); color: white; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* === FORMS === */
.form-label { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 5px; display: block; }
.form-control, .form-select {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 7px; font-size: 14px;
  background: var(--white); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14,165,176,0.12);
}
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* === ALERTS === */
.alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 13.5px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-danger  { background: #FFF1F1; border: 1px solid #FECACA; color: #991B1B; }
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1D4ED8; }

/* === POS INTERFACE === */
.pos-grid { display: grid; grid-template-columns: 1fr 400px; gap: 0; height: calc(100vh - 58px - 48px); }
.pos-products { padding: 16px; overflow-y: auto; background: var(--off-white); }
.pos-cart { background: var(--white); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.pos-cart-header { padding: 16px; border-bottom: 1px solid var(--border); }
.pos-cart-items { flex: 1; overflow-y: auto; padding: 0 16px; }
.pos-cart-footer { padding: 16px; border-top: 1px solid var(--border); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.product-tile {
  background: var(--white); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 16px 12px;
  text-align: center; cursor: pointer;
  transition: all 0.15s;
}
.product-tile:hover { border-color: var(--teal); transform: translateY(-1px); box-shadow: var(--shadow); }
.product-tile .p-name { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.product-tile .p-price { font-size: 15px; color: var(--teal); font-weight: 700; }
.product-tile .p-cat { font-size: 11px; color: var(--slate); }

/* === WEBSITE HERO === */
.site-nav {
  background: var(--navy); color: white;
  padding: 0 40px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
}
.site-nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.site-nav-links a { color: #B8C8D8; font-size: 14px; font-weight: 500; transition: color 0.15s; }
.site-nav-links a:hover { color: var(--teal-light); }
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #0A2840 100%);
  color: white; padding: 100px 40px 80px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(14,165,176,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content { max-width: 680px; position: relative; }
.hero-eyebrow {
  display: inline-block; padding: 4px 14px;
  background: rgba(14,165,176,0.15); border: 1px solid rgba(14,165,176,0.3);
  border-radius: 20px; color: var(--teal-light);
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 20px;
}
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.1; margin: 0 0 20px; }
.hero h1 span { color: var(--teal-light); }
.hero-sub { font-size: 17px; color: #B8C8D8; margin-bottom: 32px; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.site-section { padding: 72px 40px; max-width: 1100px; margin: 0 auto; }
.section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--teal); font-weight: 700; margin-bottom: 10px;
}
.section-title { font-size: 32px; font-weight: 800; color: var(--navy); margin: 0 0 16px; line-height: 1.2; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 48px; }
.feature-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: 0 8px 32px rgba(10,22,40,0.1); transform: translateY(-2px); }
.feature-icon {
  width: 48px; height: 48px; background: rgba(14,165,176,0.1);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
}
.feature-title { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: var(--slate); line-height: 1.6; }
.site-footer { background: var(--navy); color: #8FAABF; padding: 48px 40px 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand-name { color: white; font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.footer-desc { font-size: 13px; line-height: 1.6; }
.footer-heading { color: white; font-size: 13px; font-weight: 700; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #8FAABF; font-size: 13px; transition: color 0.15s; }
.footer-links a:hover { color: var(--teal-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 20px; font-size: 12px; text-align: center; }

/* === RECEIPT PRINT === */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrap { margin-left: 0 !important; }
  .receipt { max-width: 400px; margin: 0 auto; font-size: 12px; }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .pos-grid { grid-template-columns: 1fr; height: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 32px; }
}
