/**
 * NIRVAH Financial Platform - Admin Portal Stylesheet
 */

@import url('variables.css');
@import url('style.css');

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background-color: var(--dark-green);
  color: var(--white);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.admin-sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-nav {
  padding: var(--space-4) 0;
  flex-grow: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  color: #D1D5DB;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--light-gold);
  border-left: 4px solid var(--gold);
}

.admin-main {
  flex-grow: 1;
  background-color: #F3F4F6;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
  height: 64px;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-content {
  padding: var(--space-6);
  flex-grow: 1;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--dark-green);
  margin-top: var(--space-2);
}

.stat-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  font-weight: 600;
}

.admin-dashboard-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.admin-eyebrow { margin: 0 0 8px; color: var(--gold-deep); font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.admin-dashboard-intro h1 { margin: 0; color: var(--dark-green); font-size: clamp(1.55rem, 3vw, 2.2rem); letter-spacing: -.04em; }
.admin-dashboard-intro > div:first-child > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .86rem; }
.admin-live-indicator, .admin-sync-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.admin-live-indicator span, .admin-sync-badge span { width: 7px; height: 7px; border-radius: 50%; background: #35b978; box-shadow: 0 0 0 4px rgba(53,185,120,.12); }
.admin-stat-grid { margin-bottom: 28px; }
.admin-stat-card { position: relative; overflow: hidden; min-height: 168px; padding: 22px; border: 1px solid #e3e9e3; border-radius: 16px; box-shadow: 0 8px 20px rgba(20,55,31,.06); }
.admin-stat-card::after { content: ''; position: absolute; right: -28px; bottom: -38px; width: 110px; height: 110px; border-radius: 50%; background: rgba(34,131,78,.07); }
.admin-stat-icon { position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--green-light); color: var(--green); font-weight: 800; }
.admin-stat-pending .admin-stat-icon { background: var(--gold-light); color: var(--gold-deep); }
.admin-stat-disbursed .admin-stat-icon { background: #e5f5ec; color: #14713a; }
.admin-stat-card .stat-label { margin-top: 16px; }
.admin-stat-card .stat-value { margin-top: 10px; font-size: 1.9rem; letter-spacing: -.04em; }
.admin-stat-note { display: block; margin-top: 7px; color: var(--muted); font-size: .7rem; }
.admin-table-card { overflow: hidden; border: 1px solid #e1e8e1; border-radius: 16px; box-shadow: 0 8px 20px rgba(20,55,31,.06); }
.admin-table-header { min-height: 86px; padding: 20px 24px; }
.admin-table-header .admin-eyebrow { margin-bottom: 5px; }
.admin-table-header h2 { margin: 0; color: var(--dark-green); font-size: 1.08rem; }
.admin-sync-badge { padding: 8px 12px; border: 1px solid #dce9df; border-radius: 999px; background: #f8fcf9; }
.admin-applications-table thead th { background: #f7faf7; color: #668171; font-size: .67rem; letter-spacing: .08em; }
.admin-applications-table tbody td { padding-top: 17px; padding-bottom: 17px; color: #385344; font-size: .8rem; }
.admin-applications-table tbody tr:hover { background: #fbfefb; }

.admin-documents-page { width: 100%; max-width: 1560px; margin: 0 auto; color: #173d29; }
.admin-documents-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 24px; }
.admin-documents-eyebrow { margin: 0 0 7px; color: #a07810; font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.admin-documents-intro h1 { margin: 0; color: #103c25; font-size: 1.55rem; line-height: 1.25; font-weight: 800; }
.admin-documents-intro > div > p:last-child { margin: 7px 0 0; color: #728478; font-size: .84rem; }
.admin-documents-live { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid #dce9df; border-radius: 8px; background: #fff; color: #52715e; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.admin-documents-live span { width: 8px; height: 8px; border-radius: 50%; background: #2c9a5b; box-shadow: 0 0 0 4px #e4f4e9; }
.admin-documents-filters { overflow: hidden; border: 1px solid #e0e9e2; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(20,55,31,.045); }
.admin-documents-filters .card-body { padding: 15px 18px !important; }
.admin-documents-filters .card-body > .flex { align-items: center; }
.admin-documents-tabs { gap: 5px !important; padding: 4px; border-radius: 9px; background: #f4f7f4; }
.admin-documents-tabs .btn { min-height: 36px; padding: 8px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #65786b; font-size: .75rem; font-weight: 650; box-shadow: none; }
.admin-documents-tabs .btn:hover { background: #fff; color: #17472c; }
.admin-documents-tabs .btn-primary { background: #145b32; color: #fff; box-shadow: 0 2px 6px rgba(14,72,38,.16); }
.admin-documents-tabs .btn-primary:hover { background: #0f4a29; color: #fff; }
.admin-documents-search { align-items: center; gap: 8px !important; }
.admin-documents-search-input { width: min(280px, 28vw); min-width: 190px; height: 40px; padding: 0 12px; border: 1px solid #dbe5dd; border-radius: 7px; background: #fff; color: #244b34; font: inherit; font-size: .8rem; }
.admin-documents-search-input::placeholder { color: #95a399; }
.admin-documents-search-input:focus { outline: none; border-color: #39865a; box-shadow: 0 0 0 3px rgba(45,128,80,.1); }
.admin-documents-search .btn { min-height: 40px; padding: 0 16px; border-radius: 7px; font-size: .78rem; box-shadow: none; }
.admin-documents-search .btn-outline { padding: 0 12px; border-width: 1px; }
.admin-documents-card { overflow: hidden; border: 1px solid #e0e8e1; border-radius: 12px; background: #fff; box-shadow: 0 6px 20px rgba(20,55,31,.05); }
.admin-documents-card-header { min-height: 66px; padding: 17px 20px; border-bottom: 1px solid #e7eee8; background: linear-gradient(110deg, #f5faf6, #fffdf6); }
.admin-documents-card-header h3 { color: #173f29; font-size: .95rem !important; font-weight: 750; }
.admin-documents-card-header > .badge { padding: 6px 9px; border: 1px solid #dce9df; border-radius: 6px; background: #fff; color: #557362; font-size: .68rem; font-weight: 700; }
.admin-documents-card .card-body { padding: 0 !important; }
.admin-documents-card .table-responsive { width: 100%; overflow-x: auto; border: 0 !important; }
.admin-documents-table { width: 100%; min-width: 900px; margin: 0; border-collapse: separate; border-spacing: 0; text-align: left; }
.admin-documents-table thead th { padding: 12px 14px; border: 0; border-bottom: 1px solid #244c35; background: #17492e; color: #fff; font-size: .66rem; line-height: 1.4; font-weight: 700; letter-spacing: .045em; white-space: nowrap; }
.admin-documents-table tbody td { padding: 14px; border: 0; border-bottom: 1px solid #edf1ed; color: #3e5948; font-size: .78rem; line-height: 1.5; vertical-align: middle; }
.admin-documents-table tbody tr:nth-child(even) { background: #fbfcfb; }
.admin-documents-table tbody tr:hover { background: #f3f8f4; }
.admin-documents-table tbody tr:last-child td { border-bottom: 0; }
.admin-documents-table .badge { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; font-size: .66rem; font-weight: 750; white-space: nowrap; }
.admin-documents-table .badge-success { border-color: #cce8d4; background: #eaf7ee; color: #17633a; }
.admin-documents-table .badge-danger { border-color: #f1d2d0; background: #fff0ef; color: #aa3931; }
.admin-documents-table .badge-warning { border-color: #f1e1b5; background: #fff8e5; color: #8a6513; }
.admin-documents-table .badge-info { border-color: #d9e7ed; background: #eff7fa; color: #386276; }
.admin-documents-table .badge-gold { border-color: #f1e2b5; background: #fff8e6; color: #86620d; }
.admin-documents-table .btn { min-height: 31px; padding: 6px 9px; border-radius: 6px; font-size: .68rem; box-shadow: none; }
.admin-documents-empty { padding: 34px 18px !important; color: #7a8b80 !important; font-size: .8rem !important; text-align: center !important; }
.admin-loan-table { min-width: 820px; }
.admin-loan-table tbody td:nth-child(6) { font-weight: 700; }
.admin-audit-table { min-width: 860px; }

@media (max-width: 960px) {
  .admin-documents-intro { align-items: flex-start; flex-direction: column; gap: 14px; }
  .admin-documents-filters .card-body > .flex { align-items: stretch; }
  .admin-documents-tabs { overflow-x: auto; flex-wrap: nowrap !important; }
  .admin-documents-tabs .btn { flex-shrink: 0; }
  .admin-documents-search { width: 100%; }
  .admin-documents-search-input { width: auto; min-width: 0; flex: 1; }
}

@media (max-width: 560px) {
  .admin-documents-intro h1 { font-size: 1.25rem; }
  .admin-documents-filters .card-body { padding: 12px !important; }
  .admin-documents-tabs { margin: 0 -2px; }
  .admin-documents-search .btn { padding: 0 12px; }
  .admin-documents-card-header { align-items: flex-start; flex-direction: column; gap: 8px; padding: 15px 16px; }
}

@media (max-width: 760px) {
  .admin-layout { display: block; min-width: 0; }
  .admin-sidebar { width: 100%; }
  .admin-sidebar-header { min-height: 76px; padding: 10px 16px; }
  .admin-sidebar-header img { height: 48px !important; }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px; }
  .admin-nav-item { flex: 1 1 auto; justify-content: center; gap: 6px; padding: 9px 8px; border-left: 0; font-size: .74rem; white-space: nowrap; }
  .admin-nav-item:hover,
  .admin-nav-item.active { border-left: 0; border-bottom: 2px solid var(--gold); }
  .admin-nav-item[style*="margin-top"] { margin-top: 0 !important; }
  .admin-main,
  .admin-content { width: 100%; min-width: 0; }
  .admin-topbar { min-height: 56px; height: auto; padding: 10px 16px; }
  .admin-topbar h4 { font-size: .82rem; }
  .admin-topbar .badge { font-size: .62rem; }
  .admin-content { padding: 16px 12px; }
  .admin-documents-page { width: 100%; min-width: 0; }
  .admin-documents-table { width: max-content; }
  .admin-documents-card .table-responsive { max-width: 100%; }
  .admin-documents-tabs { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .admin-documents-tabs .btn { white-space: normal; }
  .admin-documents-empty { display: block; width: calc(100vw - 32px); box-sizing: border-box; }
}

.admin-login-page {
  min-height: 100vh;
  margin: 0;
  background: #f5f7f4;
  color: var(--dark-green);
}

.admin-login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.1fr);
}

.admin-login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 7vw, 84px);
  color: #fff;
  background: radial-gradient(circle at 15% 10%, rgba(212, 160, 23, .2), transparent 36%), linear-gradient(145deg, #082f1c, #124b2b 65%, #1d6c3a);
}

.admin-login-logo { width: 148px; height: auto; filter: brightness(0) invert(1); }
.admin-login-kicker { margin: 0 0 18px; color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.admin-login-brand h1 { margin: 52px 0 18px; color: #fff; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.04; letter-spacing: -.04em; }
.admin-login-brand h1 span { color: #e8c75b; }
.admin-login-description { max-width: 330px; color: rgba(255,255,255,.7); font-size: .92rem; line-height: 1.7; }
.admin-login-status { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.72); font-size: .75rem; }
.admin-login-status span { width: 8px; height: 8px; border-radius: 50%; background: #54dfa0; box-shadow: 0 0 12px #54dfa0; }

.admin-login-form-panel { display: flex !important; flex-direction: column; justify-content: center; width: min(100%, 500px) !important; padding: clamp(32px, 7vw, 90px); }
.admin-login-form-heading h2 { margin: 0 0 8px; color: var(--dark-green); font-size: 2.1rem; letter-spacing: -.04em; }
.admin-login-form-heading > p:last-child { margin: 0 0 34px; color: var(--muted); font-size: .88rem; }
.admin-login-card { padding: 0; }
.admin-login-card .form-group { display: block !important; width: 100% !important; margin-bottom: 20px; }
.admin-login-card .form-label { display: block !important; width: 100% !important; margin-bottom: 8px; color: var(--dark-green); font-size: .82rem; font-weight: 700; }
.admin-login-card .form-control { display: block !important; width: 100% !important; box-sizing: border-box; }
.admin-login-input { min-height: 52px; border: 1px solid #d7dfd8; border-radius: 10px; background: #fff; }
.admin-login-input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(26,107,47,.1); }
.admin-login-submit { min-height: 52px; border-radius: 10px; display: flex; justify-content: center; align-items: center; gap: 14px; box-shadow: 0 12px 22px rgba(26,107,47,.18); }
.admin-login-submit span { font-size: 1.2rem; transition: transform .2s ease; }
.admin-login-submit:hover span { transform: translateX(4px); }
.admin-login-alert { margin-bottom: 22px; }
.admin-login-back { display: inline-block; margin-top: 26px; color: var(--muted); font-size: .8rem; }
.admin-login-back:hover { color: var(--dark-green); }

@media (max-width: 760px) {
  .admin-login-shell { display: block; }
  .admin-login-brand { min-height: 260px; padding: 30px 24px; }
  .admin-login-brand h1 { margin: 28px 0 12px; font-size: 2.35rem; }
  .admin-login-description { display: none; }
  .admin-login-form-panel { width: 100%; padding: 36px 24px 44px; }

  .admin-dashboard-intro { align-items: flex-start; flex-direction: column; gap: 14px; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-stat-card { min-height: 150px; padding: 17px; }
  .admin-stat-card .stat-value { font-size: 1.5rem; }
  .admin-table-header { align-items: flex-start; flex-direction: column; gap: 12px; }
}
