/* ============================================================
   assets/css/style.css  —  Bank Statement Portal
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
  --primary: #1a3a6b;
  --primary-light: #e8eef7;
  --accent: #2563eb;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --sidebar-bg: #0f2550;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #2563eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; }

/* LOGIN */
body.login-page {
  background: linear-gradient(135deg, #0f2550 0%, #1a3a6b 50%, #2563eb 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 16px; }
.login-card { border-radius: 16px; border: none; }
.login-logo { max-height: 70px; max-width: 200px; }
.login-icon { width: 64px; height: 64px; background: var(--primary-light); border-radius: 16px;
              display: inline-flex; align-items: center; justify-content: center; }

/* SIDEBAR */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh;
  width: var(--sidebar-width); background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  transition: width .25s ease; z-index: 1000; overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-user { padding: 12px 0; justify-content: center; }

.main-content { margin-left: var(--sidebar-width); min-height: 100vh; transition: margin-left .25s ease; }
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 16px;
  color: #fff; font-size: 1.1rem; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; flex-shrink: 0;
}
.sidebar-logo { max-height: 38px; max-width: 120px; object-fit: contain; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.user-avatar { font-size: 2rem; color: rgba(255,255,255,.5); flex-shrink: 0; }
.user-name { color: #fff; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,.5); font-size: .72rem; }

.sidebar-nav { list-style: none; margin: 0; padding: 8px 0; flex: 1; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.nav-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
             color: rgba(255,255,255,.35); padding: 14px 16px 4px; white-space: nowrap; }
.nav-item .nav-link {
  display: flex; align-items: center; gap: 12px; color: var(--sidebar-text);
  padding: 9px 16px; border-radius: 8px; margin: 2px 8px; font-size: .87rem;
  text-decoration: none; white-space: nowrap; transition: background .15s, color .15s;
}
.nav-item .nav-link i { width: 18px; text-align: center; flex-shrink: 0; font-size: .95rem; }
.nav-item .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item .nav-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.sidebar-footer .nav-link { margin: 0; border-radius: 8px; }

/* TOPBAR */
.topbar {
  height: var(--topbar-height); background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow);
}
.topbar-right { display: flex; align-items: center; }

/* CONTENT */
.content-area { padding: 24px; }

/* CARDS */
.card { border-radius: var(--radius); }
.card-header { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0 !important; }

/* STAT ICON */
.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}

/* TABLES */
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table-hover tbody tr:hover { background: #f8faff; }

/* UPLOAD ZONE */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 36px 20px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: #f0f5ff; }

/* MISC */
.breadcrumb { font-size: .8rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-label { font-size: .88rem; margin-bottom: .35rem; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.logo-preview { max-height: 80px; max-width: 220px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
.page-link { color: var(--accent); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); }
.alert { border-radius: var(--radius); border: none; }
.w-40 { width: 40%; }
code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: .82rem; color: #0f2550; }
.text-primary { color: var(--accent) !important; }
.bg-primary { background: var(--accent) !important; }

@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .brand-name, .sidebar .nav-link span, .sidebar .user-info, .sidebar .nav-label { display: none; }
  .sidebar .nav-link { justify-content: center; padding: 10px; }
  .sidebar .sidebar-user { padding: 12px 0; justify-content: center; }
  .main-content { margin-left: var(--sidebar-collapsed); }
  .content-area { padding: 16px; }
}

@media print {
  .sidebar, .topbar, .btn, .alert { display: none !important; }
  .main-content { margin-left: 0 !important; }
}
