/* =========================================================
   Jeevan Industries - Design System
   ========================================================= */
:root{
  --primary:#1a56db;
  --primary-dark:#153e9e;
  --primary-light:#e8f0fe;
  --accent:#0d9488;
  --sidebar-bg:#111827;
  --sidebar-hover:#1f2937;
  --sidebar-active:#1a56db;
  --success:#16a34a;
  --danger:#dc2626;
  --warning:#d97706;
  --info:#0891b2;
  --text-dark:#111827;
  --text-muted:#6b7280;
  --border:#e5e7eb;
  --bg:#f4f6f9;
  --card-radius:12px;
  --shadow:0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:0 4px 12px rgba(0,0,0,.08);
  font-family:'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  background:var(--bg);
  color:var(--text-dark);
  font-size:14.5px;
  margin:0;
}

/* ---------- Login Page ---------- */
.login-body{
  background:linear-gradient(135deg,#0f2557 0%, #1a56db 55%, #0d9488 100%);
  display:flex; align-items:center; justify-content:center; min-height:100vh;
}
.login-wrap{width:100%; max-width:420px; padding:20px;}
.login-card{
  background:#fff; border-radius:16px; padding:36px 32px;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
}
.login-brand{text-align:center; margin-bottom:22px;}
.login-logo{
  width:64px; height:64px; border-radius:50%;
  background:var(--primary-light); color:var(--primary);
  display:flex; align-items:center; justify-content:center;
  font-size:28px; margin:0 auto 12px;
}
.login-brand h1{font-size:22px; font-weight:700; margin:0;}
.login-brand p{color:var(--text-muted); font-size:13px; margin-top:2px;}
.login-hint{text-align:center; font-size:12.5px; color:var(--text-muted); margin-top:16px; margin-bottom:0;}

/* ---------- App Shell ---------- */
.app-shell{display:flex; min-height:100vh;}
.sidebar{
  width:250px; background:var(--sidebar-bg); color:#cbd5e1; flex-shrink:0;
  position:fixed; top:0; left:0; height:100vh; overflow-y:auto; z-index:1000;
  transition:transform .25s ease;
}
.sidebar-brand{
  display:flex; align-items:center; gap:10px; padding:20px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo-icon{
  width:38px; height:38px; border-radius:10px; background:var(--primary);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:17px;
}
.sidebar-brand div b{color:#fff; font-size:15px; display:block; line-height:1.2;}
.sidebar-brand div span{font-size:11px; color:#9ca3af;}

.sidebar-nav{padding:10px 0; list-style:none; margin:0;}
.sidebar-nav .nav-section{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.06em;
  color:#6b7280; padding:14px 18px 6px;
}
.sidebar-nav a{
  display:flex; align-items:center; gap:11px; padding:10px 18px;
  color:#cbd5e1; text-decoration:none; font-size:13.6px; font-weight:500;
  border-left:3px solid transparent; transition:.15s;
}
.sidebar-nav a i{width:18px; text-align:center; font-size:14px;}
.sidebar-nav a:hover{background:var(--sidebar-hover); color:#fff;}
.sidebar-nav a.active{background:rgba(26,86,219,.18); color:#fff; border-left-color:var(--primary);}

.main-content{margin-left:250px; flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{
  background:#fff; border-bottom:1px solid var(--border);
  padding:12px 24px; display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:900;
}
.topbar h4{margin:0; font-size:18px; font-weight:700;}
.topbar .breadcrumb-sub{font-size:12.5px; color:var(--text-muted); margin:0;}
.topbar-right{display:flex; align-items:center; gap:16px;}
.user-chip{display:flex; align-items:center; gap:8px; font-size:13.5px;}
.user-chip .avatar{
  width:34px; height:34px; border-radius:50%; background:var(--primary);
  color:#fff; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:14px;
}
.page-body{padding:22px 24px 40px; flex:1;}

.sidebar-toggle{display:none; background:none; border:none; font-size:20px; color:var(--text-dark); cursor:pointer;}

@media (max-width: 991px){
  .sidebar{transform:translateX(-100%);}
  .sidebar.open{transform:translateX(0);}
  .main-content{margin-left:0;}
  .sidebar-toggle{display:inline-block;}
}

/* ---------- Cards / KPIs ---------- */
.kpi-card{
  background:#fff; border-radius:var(--card-radius); padding:18px 20px;
  box-shadow:var(--shadow); border:1px solid var(--border);
  display:flex; align-items:center; gap:14px; height:100%;
}
.kpi-icon{
  width:48px; height:48px; border-radius:12px; display:flex; align-items:center;
  justify-content:center; font-size:20px; flex-shrink:0;
}
.kpi-card .kpi-label{font-size:12.5px; color:var(--text-muted); margin:0; font-weight:600; text-transform:uppercase; letter-spacing:.03em;}
.kpi-card .kpi-value{font-size:22px; font-weight:700; margin:2px 0 0;}
.kpi-card .kpi-sub{font-size:11.5px; margin-top:2px;}

.card{border:1px solid var(--border); border-radius:var(--card-radius); box-shadow:var(--shadow);}
.card-header-flex{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
  padding:16px 20px; border-bottom:1px solid var(--border); background:#fff;
  border-radius:var(--card-radius) var(--card-radius) 0 0;
}
.card-header-flex h5{margin:0; font-size:16px; font-weight:700;}

.panel{background:#fff; border-radius:var(--card-radius); border:1px solid var(--border); box-shadow:var(--shadow);}
.panel-body{padding:20px;}

/* ---------- Tables ---------- */
.table-modern{width:100%; border-collapse:collapse; font-size:13.6px;}
.table-modern thead th{
  background:#f8fafc; color:#4b5563; font-weight:700; font-size:11.8px;
  text-transform:uppercase; letter-spacing:.03em; padding:11px 14px; border-bottom:1px solid var(--border);
  white-space:nowrap;
}
.table-modern tbody td{padding:11px 14px; border-bottom:1px solid #f1f3f6; vertical-align:middle;}
.table-modern tbody tr:hover{background:#f8fafc;}
.table-responsive-wrap{overflow-x:auto; border-radius:0 0 var(--card-radius) var(--card-radius);}

.badge-status{padding:4px 10px; font-size:11.5px; font-weight:700; border-radius:20px; letter-spacing:.02em;}
.badge-paid{background:#dcfce7; color:#166534;}
.badge-partial{background:#fef3c7; color:#92400e;}
.badge-unpaid{background:#fee2e2; color:#991b1b;}
.badge-draft{background:#e5e7eb; color:#374151;}
.badge-sent{background:#dbeafe; color:#1e40af;}
.badge-accepted{background:#dcfce7; color:#166534;}
.badge-rejected{background:#fee2e2; color:#991b1b;}
.badge-converted{background:#ede9fe; color:#5b21b6;}
.badge-low{background:#fee2e2; color:#991b1b;}
.badge-ok{background:#dcfce7; color:#166534;}

.btn{border-radius:8px; font-size:13.5px; font-weight:600;}
.btn-primary{background:var(--primary); border-color:var(--primary);}
.btn-primary:hover{background:var(--primary-dark); border-color:var(--primary-dark);}
.btn-sm{padding:5px 10px;}
.btn-icon{width:32px; height:32px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius:8px;}
.form-control, .form-select{border-radius:8px; font-size:13.8px; border-color:#d1d5db;}
.form-control:focus, .form-select:focus{border-color:var(--primary); box-shadow:0 0 0 3px rgba(26,86,219,.12);}
.form-label{font-size:13px; font-weight:600; color:#374151; margin-bottom:5px;}
.modal-content{border-radius:14px; border:none;}
.modal-header{border-bottom:1px solid var(--border);}
.modal-footer{border-top:1px solid var(--border);}

.search-box{position:relative;}
.search-box i{position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#9ca3af; font-size:13px;}
.search-box input{padding-left:34px;}

.empty-state{text-align:center; padding:50px 20px; color:var(--text-muted);}
.empty-state i{font-size:42px; opacity:.35; margin-bottom:10px;}

.stock-bar{height:6px; background:#e5e7eb; border-radius:4px; overflow:hidden; width:80px; display:inline-block; vertical-align:middle;}
.stock-bar-fill{height:100%; border-radius:4px;}

.toast-container{z-index:2000;}

.spinner-overlay{
  position:fixed; inset:0; background:rgba(255,255,255,.6); z-index:3000;
  display:flex; align-items:center; justify-content:center;
}

::-webkit-scrollbar{width:8px; height:8px;}
::-webkit-scrollbar-thumb{background:#c7cdd6; border-radius:8px;}
::-webkit-scrollbar-track{background:transparent;}

/* ---------- Print (Invoice / Quotation) ---------- */
@media print{
  .no-print{display:none !important;}
  body{background:#fff;}
  .print-sheet{box-shadow:none !important; border:none !important; margin:0 !important; width:100% !important;}
}
