 :root{
  --font-family: 'Segoe UI', Arial, sans-serif;
  --bg-main: #eef3f8;
  --bg-panel: #ffffff;
  --bg-sidebar: #0f2740;
  --bg-sidebar-soft: #173a5d;
  --text-main: #16324a;
  --text-soft: #6b7d90;
  --text-light: #dce9f5;
  --border: #d9e3ec;
  --primary: #2b6ea6;
  --primary-dark: #1f5988;
  --success: #1f9d6a;
  --warning: #d89a1b;
  --danger: #d85c4b;
  --neutral: #6885a0;
  --shadow: 0 10px 26px rgba(18, 44, 70, 0.08);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html, body{ min-height:100%; }
body{
  margin:0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
}

a{ text-decoration:none; }

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

.sidebar{
  width:280px;
  background: linear-gradient(180deg, #102842 0%, #133555 100%);
  color: var(--text-light);
  display:flex;
  flex-direction:column;
  position:fixed;
  inset:0 auto 0 0;
  z-index:1040;
  transition: transform .25s ease;
  box-shadow: 8px 0 24px rgba(7, 21, 35, 0.18);
}
.sidebar-header{
  display:flex;
  align-items:center;
  gap:14px;
  padding:24px 22px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.brand-icon{
  width:54px;
  height:54px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.12);
  overflow:hidden;
  flex-shrink:0;
  font-weight:700;
  font-size:18px;
}
.brand-icon img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.brand-text h1{
  margin:0;
  font-size:20px;
  line-height:1.2;
  color:#fff;
}
.brand-text p{
  margin:4px 0 0;
  font-size:13px;
  color:rgba(220,233,245,.7);
}

.sidebar-nav{
  padding:18px 16px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:14px;
  color: var(--text-light);
  transition: background .2s ease, transform .2s ease;
  font-weight:500;
}
.nav-item i{ font-size:18px; }
.nav-item:hover{
  background: rgba(255,255,255,.08);
  color:#fff;
}
.nav-item.active{
  background: linear-gradient(90deg, rgba(48,114,167,.95), rgba(58,133,192,.95));
  color:#fff;
  box-shadow: 0 6px 16px rgba(22, 76, 121, .32);
}

.sidebar-footer{
  margin-top:auto;
  padding:16px;
}
.sidebar-footer-card{
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  padding:14px;
  background: rgba(255,255,255,.05);
}

.main-panel{
  margin-left:280px;
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.topbar{
  height:auto;
  min-height:84px;
  padding:18px 28px;
  background:#f7fbff;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  position:sticky;
  top:0;
  z-index:1000;
}
.topbar-left{
  display:flex;
  align-items:center;
  gap:16px;
}
.topbar h2{
  margin:0 0 4px;
  font-size:28px;
  line-height:1.1;
  font-weight:700;
  color:#14324b;
}
.page-subtitle{
  color: var(--text-soft);
  font-size:14px;
}
.topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
}
.admin-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--border);
  color:var(--text-main);
}
.logout-link{
  color: var(--primary);
  font-weight:600;
}

.menu-toggle{
  width:46px;
  height:46px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  color: var(--primary-dark);
  display:none;
  align-items:center;
  justify-content:center;
  font-size:22px;
}

.content-wrap{
  padding:28px;
}

.panel-card,
.stat-card{
  background: var(--bg-panel);
  border:1px solid #e3ecf3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-card{
  padding:22px;
}
.panel-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}
.panel-header h3{
  margin:0;
  font-size:22px;
  line-height:1.2;
}
.panel-header p{
  margin:6px 0 0;
  color: var(--text-soft);
  font-size:14px;
}

.stat-card{
  padding:20px;
  display:flex;
  align-items:center;
  gap:16px;
  min-height:132px;
}
.stat-card.compact{
  min-height:unset;
}
.stat-icon{
  width:56px;
  height:56px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  color:#fff;
  flex-shrink:0;
}
.stat-icon.blue{ background: linear-gradient(135deg, #2b6ea6, #3d89ca); }
.stat-icon.cyan{ background: linear-gradient(135deg, #2d8ea8, #49b8d5); }
.stat-icon.green{ background: linear-gradient(135deg, #22885e, #37b67d); }
.stat-icon.amber{ background: linear-gradient(135deg, #b97f12, #e3a324); }

.stat-content{
  min-width:0;
}
.stat-label{
  color: var(--text-soft);
  font-size:14px;
  margin-bottom:6px;
}
.stat-value{
  font-size:34px;
  font-weight:700;
  line-height:1.05;
  color:#13314b;
}
.stat-small{
  font-size:22px;
}
.stat-note{
  color:var(--text-main);
  font-weight:600;
}

.summary-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:16px;
}
.summary-box{
  display:block;
  padding:18px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#f9fbfd;
  transition: all .18s ease;
  color:inherit;
}
.summary-box:hover{
  transform: translateY(-2px);
  border-color:#b7d2e7;
  background:#fff;
}
.summary-title{
  font-weight:700;
  margin-bottom:8px;
}
.summary-desc{
  color:var(--text-soft);
  font-size:14px;
  line-height:1.45;
}

.note-panel{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:16px;
  border-radius:16px;
  background:#f4f9ff;
  border:1px solid #d7e8f5;
  color:var(--text-main);
}
.note-panel code{
  background:#e8f2fb;
  padding:2px 6px;
  border-radius:8px;
}
.note-icon{
  width:40px;
  height:40px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#dcebfa;
  color:var(--primary-dark);
  flex-shrink:0;
}
.mini-stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
.mini-stat{
  padding:14px;
  border-radius:14px;
  background:#f9fbfd;
  border:1px solid var(--border);
}
.mini-label{
  display:block;
  color:var(--text-soft);
  font-size:13px;
  margin-bottom:6px;
}

.action-toolbar{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:end;
  flex-wrap:wrap;
}
.toolbar-form{
  min-width:250px;
}
.toolbar-grow{
  flex:1;
}
.field-label{
  display:block;
  font-size:13px;
  font-weight:700;
  color:var(--text-soft);
  margin-bottom:8px;
  letter-spacing:.02em;
  text-transform:uppercase;
}
.helper-text{
  color:var(--text-soft);
  font-size:13px;
  margin-top:8px;
}

.form-control,
.form-select,
.input-group-text{
  border-radius:14px;
  min-height:48px;
  border:1px solid #d4e1eb;
  box-shadow:none !important;
}
.form-control:focus,
.form-select:focus{
  border-color:#7daed6;
}
.form-control-lg{
  min-height:56px;
  border-radius:16px;
}
.input-group .form-control{
  border-top-left-radius:0;
  border-bottom-left-radius:0;
}
.input-group .input-group-text{
  background:#f5f9fd;
}

.btn{
  border-radius:14px;
  min-height:46px;
  padding-inline:18px;
  font-weight:600;
}
.btn-sm{
  min-height:38px;
  border-radius:12px;
}
.btn-primary{
  background: linear-gradient(180deg, #2e73ab, #255f92);
  border-color:#255f92;
}
.btn-primary:hover{
  background: linear-gradient(180deg, #255f92, #1f537f);
  border-color:#1f537f;
}
.btn-outline-primary{
  color:#245f92;
  border-color:#adc8df;
}
.btn-outline-secondary{
  color:#5b7084;
  border-color:#c8d6e2;
}
.btn-outline-dark{
  color:#2b4258;
  border-color:#c1d1de;
}
.btn-outline-warning{
  color:#a86e0f;
  border-color:#e9cb86;
}

.table-card{
  padding-top:18px;
}
.custom-table{
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(245, 249, 253, 0.82);
}
.custom-table thead th{
  font-size:13px;
  color:var(--text-soft);
  text-transform:uppercase;
  letter-spacing:.03em;
  padding:16px 14px;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}
.custom-table tbody td{
  padding:16px 14px;
  border-bottom:1px solid #e8eef4;
  vertical-align:middle;
}
.custom-table tbody tr:hover{
  background:#fbfdff;
}
.checkbox-col{
  width:48px;
}
.table-title{
  font-weight:700;
  color:#173651;
}
.table-subtitle{
  margin-top:4px;
  color:var(--text-soft);
  font-size:13px;
}
.empty-cell{
  text-align:center;
  color:var(--text-soft);
  padding:34px 16px !important;
}
.action-select{
  min-width:150px;
}

.status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:4px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
}
.status-badge.success{
  background:#e6f7ef;
  color:#1b8a5d;
}
.status-badge.danger{
  background:#fdeceb;
  color:#c14f43;
}
.status-badge.neutral{
  background:#eef4f9;
  color:#58738d;
}

.preview-box{
  min-height:280px;
  white-space:pre-line;
  border:1px dashed #c5d8e8;
  background:#f8fbfe;
  border-radius:16px;
  padding:18px;
  color:var(--text-soft);
}

.checkbox-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}
.check-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#f9fbfd;
}
.check-card input{
  width:18px;
  height:18px;
}

.logo-preview{
  min-height:240px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px dashed #c7d9e7;
  border-radius:18px;
  background:#f8fbfe;
  padding:16px;
}
.logo-preview img{
  max-width:100%;
  max-height:200px;
  object-fit:contain;
}
.empty-state-box{
  min-height:240px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px dashed #c7d9e7;
  border-radius:18px;
  background:#f8fbfe;
  color:var(--text-soft);
  text-align:center;
  padding:16px;
}

.custom-alert{
  border:none;
  border-radius:16px;
  box-shadow: var(--shadow);
}

.copy-toast{
  position:fixed;
  right:22px;
  bottom:22px;
  background:#11304c;
  color:#fff;
  padding:12px 16px;
  border-radius:14px;
  box-shadow: 0 12px 24px rgba(0,0,0,.18);
  opacity:0;
  transform: translateY(10px);
  transition: all .2s ease;
  z-index:2000;
}
.copy-toast.show{
  opacity:1;
  transform: translateY(0);
}

.sidebar-overlay{
  position:fixed;
  inset:0;
  background:rgba(8, 20, 31, .45);
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease;
  z-index:1030;
}
.sidebar-overlay.show{
  opacity:1;
  pointer-events:auto;
}

.login-body{
  min-height:100vh;
  background:
    radial-gradient(circle at top right, rgba(63, 122, 176, 0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(44, 91, 136, 0.16), transparent 28%),
    linear-gradient(180deg, #edf3f9 0%, #e8eff7 100%);
}
.login-shell{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:26px;
}
.login-card{
  width:100%;
  max-width:470px;
  background:#fff;
  border:1px solid #dfe8f0;
  border-radius:28px;
  padding:32px;
  box-shadow: 0 18px 40px rgba(18, 44, 70, 0.12);
}
.login-brand{
  text-align:center;
}
.login-badge{
  width:72px;
  height:72px;
  margin:0 auto 18px;
  border-radius:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, #2e73ab, #255f92);
  color:#fff;
  font-weight:800;
  font-size:24px;
}
.login-brand h1{
  margin:0;
  font-size:30px;
  color:#13314b;
}
.login-brand p{
  margin:8px 0 0;
  color:var(--text-soft);
}

.muted{ color:var(--text-soft); }

@media (max-width: 1199.98px){
  .summary-grid{
    grid-template-columns: 1fr;
  }
}
@media (max-width: 991.98px){
  .sidebar{
    transform: translateX(-100%);
  }
  .sidebar.show{
    transform: translateX(0);
  }
  .main-panel{
    margin-left:0;
  }
  .menu-toggle{
    display:inline-flex;
  }
}
@media (max-width: 767.98px){
  .topbar{
    padding:16px 18px;
  }
  .content-wrap{
    padding:18px;
  }
  .topbar h2{
    font-size:22px;
  }
  .topbar-right{
    display:none;
  }
  .mini-stats{
    grid-template-columns: 1fr;
  }
  .checkbox-grid{
    grid-template-columns:1fr;
  }
}
