/* =================================================
   HOA FINANCIAL SYSTEM
   CLEAN PROFESSIONAL VERSION
   LIGHT UI + DARK GREEN SIDEBAR
================================================= */

:root{
  --sidebar:#0f3d2e;
  --sidebar-hover:#145c42;
  --sidebar-active:#166534;

  --bg:#f4f6f9;
  --card:#ffffff;

  --text:#1f2937;
  --muted:#6b7280;

  --border:#e5e7eb;
  --accent:#166534;
  --danger:#dc2626;

  --radius:12px;
  --transition:.25s ease;
}

/* ================= MOBILE SIDEBAR FIX ================= */

.menu-toggle{
  display:none;
  background:none;
  border:none;
  font-size:24px;
  cursor:pointer;
}

/* overlay */
.sidebar-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  z-index:900;
}

.sidebar-overlay.show{
  display:block;
}

/* mobile behavior */
@media (max-width:768px){

  .menu-toggle{
    display:block;
  }

  .sidebar{
    transform:translateX(-100%);
    transition:transform .3s ease;
  }

  .sidebar.show{
    transform:translateX(0);
  }

  .main-content{
    margin-left:0;
  }

}

/* ================= RESET ================= */

*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

body{
  font-family:"Inter", system-ui, sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:14px;
  line-height:1.6;
}

/* ================= LAYOUT ================= */

.layout{
  display:flex;
  min-height:100vh;
}

/* ================= SIDEBAR ================= */

.sidebar{
  width:250px;
  background:var(--sidebar);
  color:white;
  position:fixed;
  height:100vh;
  display:flex;
  flex-direction:column;
  z-index:1000;
}

.sidebar-header{
  padding:20px 24px;
  font-size:14px;
  font-weight:600;
  text-transform:uppercase;
  border-bottom:1px solid rgba(255,255,255,.1);
}

.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 24px;
  text-decoration:none;
  color:#d1fae5;
  transition:var(--transition);
}

.nav-item:hover{
  background:var(--sidebar-hover);
  color:white;
}

.nav-item.active{
  background:var(--sidebar-active);
  color:white;
}

.sidebar-footer{
  margin-top:auto;
  padding:18px 24px;
  font-size:12px;
  border-top:1px solid rgba(255,255,255,.1);
  color:#a7f3d0;
}

/* ================= MAIN ================= */

.main-content{
  margin-left:250px;
  flex:1;
  display:flex;
  flex-direction:column;
}

.topbar{
  height:60px;
  background:white;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 24px;
}

.topbar-title{
  font-weight:600;
  font-size:15px;
}

.btn-logout{
  border:1px solid var(--danger);
  color:var(--danger);
  padding:6px 14px;
  border-radius:6px;
  text-decoration:none;
  font-size:13px;
  transition:var(--transition);
}

.btn-logout:hover{
  background:var(--danger);
  color:white;
}

/* ================= CONTENT ================= */

.content{
  padding:30px;
  max-width:1200px;
  margin:auto;
  width:100%;
}

/* ================= CARD ================= */

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  margin-bottom:24px;
}

.card:hover{
  box-shadow:0 6px 18px rgba(0,0,0,.05);
}

/* ================= HEADERS ================= */

.page-title{
  font-size:22px;
  font-weight:600;
}

.subtitle{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
}

.section-title{
  font-size:16px;
  font-weight:600;
  margin-bottom:16px;
}

.muted-text{
  color:var(--muted);
  font-size:13px;
}

/* ================= MEMBER HEADER ================= */

.member-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
}

.member-meta{
  text-align:right;
  font-size:13px;
}

/* ================= FORMS ================= */

.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px;
  margin-top:20px;
}

.form-group{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.form-group label{
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
}

.input,
select,
input{
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:8px;
  font-size:14px;
}

input:focus,
select:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(22,101,52,.15);
}

/* ================= BUTTONS ================= */

.btn-primary{
  background:var(--accent);
  color:white;
  border:none;
  padding:10px 18px;
  border-radius:8px;
  font-weight:600;
  cursor:pointer;
  transition:var(--transition);
}

.btn-primary:hover{
  background:var(--sidebar-active);
}

.btn-secondary{
  background:#f3f4f6;
  border:1px solid var(--border);
  padding:10px 18px;
  border-radius:8px;
  cursor:pointer;
}

.btn-danger{
  background:var(--danger);
  color:white;
  border:none;
  padding:8px 12px;
  border-radius:6px;
}

/* ================= TABLE ================= */

.table-wrapper{
  overflow-x:auto;
}

table{
  width:100%;
  border-collapse:collapse;
}

th{
  background:#f9fafb;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--muted);
  padding:14px;
  border-bottom:1px solid var(--border);
}

td{
  padding:14px;
  border-bottom:1px solid var(--border);
  font-size:14px;
}

tbody tr:hover{
  background:#f3f4f6;
}

.text-right{
  text-align:right;
}

.amount-positive{
  color:#166534;
  font-weight:600;
}

.empty{
  text-align:center;
  padding:20px;
  color:var(--muted);
}

/* ================= ALERT ================= */

.alert{
  padding:14px 18px;
  border-radius:8px;
  margin-bottom:20px;
  font-weight:500;
}

.alert-success{
  background:#ecfdf5;
  color:#065f46;
  border:1px solid #a7f3d0;
}

.alert-error{
  background:#fef2f2;
  color:#991b1b;
  border:1px solid #fecaca;
}

/* ================= RESPONSIVE ================= */

@media (max-width:768px){

  .sidebar{
    left:-250px;
  }

  .main-content{
    margin-left:0;
  }

  .member-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .btn-primary{
    width:100%;
  }

}

/* =================================================
   SMUC MODULE ENHANCEMENTS
================================================= */

/* -------- SEARCH SECTION -------- */

.search-container{
  max-width:500px;
  margin:0 auto;
}

.search-actions{
  display:flex;
  align-items:flex-end;
}

.search-actions .btn-primary{
  width:100%;
}

/* -------- MEMBER HEADER -------- */

.member-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
}

.member-meta{
  text-align:right;
  font-size:13px;
  color:var(--muted);
}

/* -------- PAYMENT CONTROLS -------- */

.payment-controls{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-top:20px;
  flex-wrap:wrap;
}

.payment-total{
  font-weight:600;
  font-size:15px;
}

.payment-total span{
  color:var(--accent);
}

/* -------- TABLE ACTIONS -------- */

.edit-form{
  display:flex;
  gap:10px;
  align-items:center;
}

.action-buttons{
  display:flex;
  gap:8px;
}

/* -------- PAGINATION -------- */

.pagination{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  margin-top:20px;
}

.pagination-info{
  font-size:13px;
  color:var(--muted);
}

/* -------- BUTTON VARIATIONS -------- */

.btn-outline{
  background:white;
  border:1px solid var(--border);
  color:var(--text);
  padding:8px 14px;
  border-radius:8px;
  font-size:13px;
  cursor:pointer;
  transition:var(--transition);
}

.btn-outline:hover{
  background:#f3f4f6;
}

.btn-small{
  padding:6px 12px;
  font-size:13px;
  border-radius:6px;
}

/* -------- TOTAL AMOUNT STYLE -------- */

.amount-highlight{
  font-weight:600;
  color:var(--accent);
}

/* -------- RESPONSIVE IMPROVEMENTS -------- */

@media (max-width:768px){

  .payment-controls{
    flex-direction:column;
    align-items:stretch;
  }

  .edit-form{
    flex-direction:column;
    align-items:stretch;
  }

  .action-buttons{
    justify-content:flex-start;
  }

}

/* ================= ALERTS ================= */

.alert{
    padding:14px 18px;
    border-radius:10px;
    margin:20px 0;
    font-size:14px;
    font-weight:500;
    border-left:5px solid;
}

.alert.success{
    background:#ecfdf5;
    color:#065f46;
    border-color:#10b981;
}

.alert.error{
    background:#fef2f2;
    color:#7f1d1d;
    border-color:#dc2626;
}

.alert.warning{
    background:#fffbeb;
    color:#92400e;
    border-color:#f59e0b;
}
/* ================= DASHBOARD ================= */

.dashboard-container{
    max-width:1300px;
    margin:30px auto;
    padding:0 20px;
}

.dashboard-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
}

.dashboard-header h1{
    margin:0;
    font-size:26px;
    font-weight:700;
}

.dashboard-header p{
    color:#6b7280;
    margin-top:4px;
}

.date-selector{
    display:flex;
    gap:10px;
}

.kpi-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-bottom:30px;
}

.kpi-card{
    background:white;
    padding:20px;
    border-radius:14px;
    box-shadow:0 8px 20px rgba(0,0,0,0.05);
    border-left:5px solid #1e40af;
}

.kpi-card span{
    font-size:12px;
    color:#6b7280;
    text-transform:uppercase;
}

.kpi-card h2{
    margin-top:10px;
    font-size:24px;
    font-weight:700;
}

.kpi-card.highlight{
    border-left:5px solid #16a34a;
}

.adjustment-card{
    margin-bottom:30px;
}

.adjustment-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-bottom:20px;
}

.readonly-display{
    padding:10px;
    background:#f3f4f6;
    border-radius:8px;
}

.action-bar{
    margin-top:15px;
    display:flex;
    justify-content:flex-end;
}

.table-section{
    display:grid;
    gap:25px;
}

.finance-table{
    width:100%;
    border-collapse:collapse;
}

.finance-table th{
    background:#f9fafb;
    font-size:12px;
    text-transform:uppercase;
    padding:12px;
    color:#6b7280;
}

.finance-table td{
    padding:12px;
    border-top:1px solid #e5e7eb;
}

.finance-table tr:hover{
    background:#f3f4f6;
}

.text-right{
    text-align:right;
}

.amount-highlight{
    font-weight:600;
    font-family:monospace;
}
.expense-total-box{
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:10px;
    padding:16px;
    margin-bottom:18px;
    text-align:center;
}

.expense-total-box h2{
    margin:6px 0 2px;
    font-size:28px;
    font-weight:700;
    color:#dc2626;
}
.alert{
    padding:12px;
    border-radius:8px;
    margin-bottom:15px;
    font-weight:600;
}

.alert.success{ background:#dcfce7; color:#166534; }
.alert.warning{ background:#fef3c7; color:#92400e; }

.status-badge{
    padding:4px 10px;
    border-radius:6px;
    font-size:12px;
    font-weight:700;
}

.status-badge.pending{ background:#fef3c7; color:#92400e; }
.status-badge.approved{ background:#dcfce7; color:#166534; }
.status-badge.rejected{ background:#fee2e2; color:#991b1b; }
.status-badge.draft{ background:#e5e7eb; color:#374151; }

.expense-total-box{
    background:#f9fafb;
    padding:14px;
    border-radius:8px;
    margin:15px 0;
    text-align:center;
}

.locked-message{
    background:#f3f4f6;
    padding:12px;
    border-radius:8px;
    text-align:center;
    font-weight:600;
}

.status-info{
    margin-top:10px;
    font-size:13px;
    color:#6b7280;
}

/* =========================================
   FINANCIAL DASHBOARD STYLES
========================================= */

/* HEADER */
.dashboard-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
  margin-bottom:20px;
}

.dashboard-header h1{
  font-size:24px;
  font-weight:700;
}

.subtitle{
  font-size:13px;
  color:var(--muted);
}

/* DATE SELECTOR */
.date-selector{
  display:flex;
  gap:10px;
}

.date-selector input{
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:8px;
}

/* KPI GRID */
.kpi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:18px;
  margin-bottom:22px;
}

.kpi-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  padding:20px;
  transition:.2s ease;
}

.kpi-card span{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.4px;
}

.kpi-card h2{
  margin-top:6px;
  font-size:22px;
  font-weight:700;
  color:var(--text);
}

.kpi-card.highlight{
  border-left:5px solid var(--accent);
}

/* EXPENSE CLASSIFICATION */
.adjustment-card{
  margin-bottom:24px;
}

.card-header-flex{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}

.badge-muted{
  font-size:11px;
  background:#f1f5f9;
  padding:4px 8px;
  border-radius:6px;
  color:#64748b;
}

/* TOTAL EXPENSE BOX */
.expense-total-box{
  background:#f9fafb;
  border:1px solid var(--border);
  border-radius:10px;
  padding:16px;
  margin-bottom:16px;
}

.expense-total-box strong{
  font-size:13px;
  color:var(--muted);
}

.expense-total-box h2{
  margin-top:6px;
  font-size:24px;
  color:var(--accent);
}

/* ADJUSTMENT GRID */
.adjustment-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
  margin-bottom:15px;
}

.adjust-box{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.adjust-box label{
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  text-transform:uppercase;
}

.adjust-box input{
  padding:10px;
  border:1px solid var(--border);
  border-radius:8px;
}

.adjust-box small{
  font-size:11px;
  color:var(--muted);
}

/* ACTION BAR */
.action-bar{
  margin-top:10px;
  display:flex;
  justify-content:flex-end;
}

/* TABLE SECTION */
.table-section{
  display:grid;
  gap:22px;
}

/* FINANCE TABLE */
.finance-table th{
  background:#f9fafb;
  font-size:11px;
  text-transform:uppercase;
  color:var(--muted);
}

.finance-table td{
  font-size:14px;
}

.amount-highlight{
  font-weight:600;
  color:var(--accent);
}

/* TABLE WRAPPER FOR MOBILE */
.table-wrapper{
  overflow-x:auto;
}

/* ================= MOBILE ================= */

@media (max-width:768px){

  .dashboard-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .date-selector{
    width:100%;
  }

  .date-selector input,
  .date-selector button{
    width:100%;
  }

  .kpi-card h2{
    font-size:20px;
  }

  .expense-total-box h2{
    font-size:20px;
  }

  .action-bar{
    justify-content:center;
  }

}
.flex-between{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
}

.date-grid{
    display:grid;
    grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
    gap:15px;
}

.form-group{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.align-end{
    justify-content:flex-end;
}

.table-wrapper{
    overflow-x:auto;
}

.finance-table{
    width:100%;
    border-collapse:collapse;
}

.finance-table th{
    text-align:left;
    padding:10px;
    border-bottom:2px solid #eee;
}

.finance-table td{
    padding:10px;
    border-bottom:1px solid #eee;
}

.text-right{
    text-align:right;
}

.amount-highlight{
    font-weight:600;
}

/* INCOME SUMMARY */
.income-summary{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:10px;
}

.income-row{
    display:flex;
    justify-content:space-between;
    padding:10px 14px;
    background:#f8fafc;
    border-radius:8px;
    font-size:14px;
}

.income-total{
    display:flex;
    justify-content:space-between;
    padding:14px;
    margin-top:6px;
    border-top:2px solid #ddd;
    font-weight:700;
    font-size:16px;
}
