/* assets/css/style.css - GST Invoice Manager Stylesheet */

:root {
  --primary:    #1a3c5e;
  --primary-lt: #2563a8;
  --accent:     #f59e0b;
  --accent2:    #10b981;
  --danger:     #ef4444;
  --bg:         #f0f4f8;
  --card-bg:    #ffffff;
  --text:       #1e293b;
  --muted:      #64748b;
  --border:     #e2e8f0;
  --sidebar-w:  260px;
  --nav-h:      60px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand h4 {
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.2;
}
.sidebar-brand span { color: var(--accent); }

.sidebar-menu { padding: 12px 0; flex: 1; }

.menu-label {
  padding: 8px 20px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.4);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.menu-item:hover,
.menu-item.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--accent);
}
.menu-item i { font-size: 1.1rem; width: 20px; text-align: center; }

/* ── Topbar ──────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--nav-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.topbar-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 50px;
  padding: 5px 14px 5px 6px;
  font-weight: 700;
  font-size: .82rem;
  color: var(--text);
  text-decoration: none;
}
.user-pill .avatar {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; font-weight: 800;
}

/* ── Main Content ────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--nav-h);
  padding: 24px;
  min-height: calc(100vh - var(--nav-h));
}

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
  overflow: hidden;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 700;
  font-size: .95rem;
}

.card-body { padding: 20px; }

/* ── Stat Cards ──────────────────────────────── */
.stat-card {
  border-radius: 14px;
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
}
.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: .9;
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .8rem;
  opacity: .8;
  margin-top: 4px;
  font-weight: 600;
}
.bg-primary-grad { background: linear-gradient(135deg,#1a3c5e,#2563a8); }
.bg-amber-grad   { background: linear-gradient(135deg,#d97706,#f59e0b); }
.bg-green-grad   { background: linear-gradient(135deg,#059669,#10b981); }
.bg-red-grad     { background: linear-gradient(135deg,#b91c1c,#ef4444); }
.bg-purple-grad  { background: linear-gradient(135deg,#6d28d9,#8b5cf6); }

/* ── Tables ──────────────────────────────────── */
.table { font-size: .875rem; }
.table th {
  font-weight: 700;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .05em;
  color: var(--muted);
  background: #f8fafc;
}
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Badges ──────────────────────────────────── */
.badge { font-weight: 700; font-size: .72rem; padding: 4px 10px; border-radius: 50px; }

/* ── Forms ───────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--border);
  font-size: .9rem;
  padding: 8px 12px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-lt);
  box-shadow: 0 0 0 3px rgba(37,99,168,.12);
}
.form-label { font-weight: 700; font-size: .85rem; color: var(--muted); }

/* ── Buttons ─────────────────────────────────── */
.btn {
  border-radius: 8px;
  font-weight: 700;
  font-size: .875rem;
  padding: 8px 18px;
  transition: all .2s;
}
.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-lt); border-color: var(--primary-lt); }
.btn-warning   { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-success   { background: var(--accent2); border-color: var(--accent2); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }

/* ── Banner ──────────────────────────────────── */
.banner-strip {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}
.banner-strip img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
}
.banner-close {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ── Page Title ──────────────────────────────── */
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
}
.page-title small {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Invoice Print ───────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .invoice-print { padding: 20px; font-size: 13px; }
}

/* ── Bottom Nav (Mobile) ─────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-items {
  display: flex;
  justify-content: space-around;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  transition: color .2s;
}
.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item.active { color: var(--primary); }

/* ── Sidebar Overlay ─────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 999;
}

/* ── PWA Install Banner ──────────────────────── */
#pwa-install {
  display: none;
  position: fixed;
  bottom: 70px; left: 12px; right: 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  z-index: 2000;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
#pwa-install.show { display: flex; }
#pwa-install .pwa-text { flex: 1; font-size: .88rem; font-weight: 700; }
#pwa-install .pwa-text small { display: block; font-weight: 400; font-size: .75rem; opacity: .8; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }
  .topbar { left: 0; }
  .main-content {
    margin-left: 0;
    padding: 16px 14px 80px;
  }
  .bottom-nav { display: block; }
  .topbar-hamburger { display: flex !important; }
  .stat-card .stat-value { font-size: 1.5rem; }
}

@media (min-width: 769px) {
  .topbar-hamburger { display: none; }
}

/* ── Login Page ──────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a3c5e 0%, #0f2035 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 80px rgba(0,0,0,.3);
}
.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}
.auth-logo .brand-icon {
  width: 60px; height: 60px;
  background: var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.8rem;
  color: #fff;
}
.auth-logo h3 { font-weight: 800; font-size: 1.2rem; color: var(--text); }
.auth-logo p { color: var(--muted); font-size: .85rem; }

/* ── Misc ────────────────────────────────────── */
.section-card { border-radius: 14px; background: #fff; padding: 20px; box-shadow: 0 1px 6px rgba(0,0,0,.04); border: 1px solid var(--border); margin-bottom: 20px; }
.text-primary { color: var(--primary) !important; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }

/* scroll thin */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 10px; }
