:root{
  --bg:#eef3ff;
  --bg-soft:#f7f9ff;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --head:#f8fafc;
  --primary:#2563eb;
  --primary-2:#1d4ed8;
  --accent:#14b8a6;
  --danger:#dc2626;
  --shadow:0 12px 28px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:'Manrope',Segoe UI,Tahoma,sans-serif;background:radial-gradient(circle at 10% -10%,#dbeafe 0,#eef3ff 36%,#f2f6ff 100%);color:var(--text);font-size:14px}
a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}

.login-page{min-height:100vh;background:radial-gradient(circle at top left,#dbeafe,#f1f5f9 48%,#e2e8f0)}
.login-page .container{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.login-wrap{width:100%;max-width:980px;display:grid;grid-template-columns:1.1fr .9fr;gap:24px}
.login-brand{background:linear-gradient(140deg,#0b1324,#1e293b);color:#e2e8f0;border-radius:18px;padding:30px;box-shadow:0 20px 45px rgba(11,19,36,.22)}
.login-brand h1{margin:0 0 10px;color:#fff;font-size:30px}
.login-card{background:#fff;border-radius:18px;padding:24px;box-shadow:var(--shadow)}
.login-card h2{margin:0 0 16px;font-size:30px}
.login-feature-list{display:grid;gap:8px;margin-top:16px}
.login-feature{padding:10px 12px;border:1px solid rgba(191,219,254,.35);border-radius:10px;background:rgba(148,163,184,.12);font-weight:700;color:#dbeafe}
.login-footnote{margin:10px 0 0;color:#64748b;font-size:12px;font-weight:600}

.app-shell{display:flex;min-height:100vh}
.sidebar{width:260px;background:linear-gradient(180deg,#0f172a,#111827 46%,#0b3a66 100%);color:#e5edff;padding:12px 10px;display:flex;flex-direction:column;gap:10px;position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:12px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12)}
.brand-dot{width:14px;height:14px;border-radius:4px;background:linear-gradient(145deg,#22d3ee,#2563eb)}
.brand-title{font-size:18px;font-weight:800;line-height:1.1}
.brand small{color:#c7d2fe;font-size:12px}
.side-nav{display:flex;flex-direction:column;gap:4px;padding-right:0}
.side-nav a{display:flex;align-items:center;gap:8px;color:#dbeafe;padding:8px 10px;border-radius:10px;font-weight:700;border:1px solid transparent;transition:.15s ease;font-size:15px}
.side-nav a .dot{font-size:11px;opacity:.8}
.side-nav a:hover{background:rgba(255,255,255,.11);border-color:rgba(255,255,255,.2);text-decoration:none;transform:translateX(2px)}
.side-nav a.active{background:linear-gradient(135deg,rgba(37,99,235,.45),rgba(20,184,166,.4));border-color:rgba(191,219,254,.55);color:#fff;box-shadow:0 8px 18px rgba(37,99,235,.25)}
.side-user{margin-top:auto;padding-top:10px;border-top:1px solid rgba(255,255,255,.16);display:grid;gap:8px}
.user-chip{display:flex;align-items:center;gap:10px}
.avatar{width:30px;height:30px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#60a5fa,#22d3ee);color:#fff;font-weight:800;font-size:13px}
.side-user small{display:block;color:#cbd5e1;margin-top:2px}

.main-area{flex:1;min-width:0;padding:12px 14px 18px}
.topbar{background:rgba(255,255,255,.86);backdrop-filter:blur(8px);border:1px solid var(--line);box-shadow:var(--shadow);padding:10px 12px;border-radius:12px;display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.topbar .crumb{color:var(--muted);font-size:12px;margin-top:2px}
.topbar-actions{display:flex;gap:10px;align-items:center}
.pill{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#eef2ff;color:#3730a3;border:1px solid #c7d2fe;font-size:12px;font-weight:700}

.container{max-width:1420px;margin:0 auto;padding:0 2px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
.grid.two{grid-template-columns:repeat(auto-fit,minmax(520px,1fr))}
.card{background:var(--card);padding:14px;border-radius:14px;border:1px solid var(--line);box-shadow:var(--shadow);overflow:hidden}
h2{margin:2px 0 12px;font-size:26px;letter-spacing:-.01em}
h3{margin:0 0 10px;font-size:19px;letter-spacing:-.01em}
h4{margin:8px 0 10px;font-size:16px}

.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}
.form-grid.three{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
label{font-size:12px;font-weight:700;color:#334155;display:flex;flex-direction:column;gap:5px}
input,select,textarea{padding:8px 10px;border:1px solid #cbd5e1;border-radius:9px;min-width:110px;background:#fff;font-family:inherit;font-weight:600;color:#0f172a;font-size:13px}
input:focus,select:focus,textarea:focus{outline:none;border-color:#60a5fa;box-shadow:0 0 0 4px rgba(96,165,250,.2)}
.checkbox{display:flex;align-items:center;gap:8px;flex-direction:row}

.toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.toolbar .actions{display:flex;gap:8px;flex-wrap:wrap}

.table-wrap{width:100%;overflow:auto;border-radius:14px;border:1px solid #dbe3ef;background:#fff}
table{width:100%;border-collapse:separate;border-spacing:0;background:#fff}
th,td{padding:9px 10px;border-bottom:1px solid #e7edf5;text-align:left;font-size:12px;vertical-align:middle;white-space:nowrap}
th{background:linear-gradient(180deg,#f9fbff,#f2f6ff);font-weight:800;color:#334155;position:sticky;top:0;z-index:1}
tr:nth-child(even) td{background:#fbfdff}
tr:hover td{background:#f1f7ff}
tr:last-child td{border-bottom:none}
.log-table{table-layout:fixed;min-width:980px}
.log-table th:nth-child(1),.log-table td:nth-child(1){width:46px}
.log-table th:nth-child(2),.log-table td:nth-child(2){width:120px}
.log-table th:nth-child(3),.log-table td:nth-child(3){width:95px}
.log-table th:nth-child(4),.log-table td:nth-child(4){width:88px}
.log-table th:nth-child(5),.log-table td:nth-child(5){width:auto;white-space:normal;word-break:break-word;line-height:1.35}
.log-table th:nth-child(6),.log-table td:nth-child(6){width:110px}
.log-table th:nth-child(7),.log-table td:nth-child(7){width:132px}
.upcoming-table{table-layout:fixed;min-width:760px}
.upcoming-table th:nth-child(1),.upcoming-table td:nth-child(1){width:28%}
.upcoming-table th:nth-child(2),.upcoming-table td:nth-child(2){width:21%}
.upcoming-table th:nth-child(3),.upcoming-table td:nth-child(3){width:21%}
.upcoming-table th:nth-child(4),.upcoming-table td:nth-child(4){width:8%}
.upcoming-table th:nth-child(5),.upcoming-table td:nth-child(5){width:22%;white-space:normal;word-break:break-word;line-height:1.35}
.sales-history-table{table-layout:fixed;min-width:980px}
.sales-history-table th:nth-child(1),.sales-history-table td:nth-child(1){width:6%}
.sales-history-table th:nth-child(2),.sales-history-table td:nth-child(2){width:23%;white-space:normal;word-break:break-word;line-height:1.35}
.sales-history-table th:nth-child(3),.sales-history-table td:nth-child(3){width:16%}
.sales-history-table th:nth-child(4),.sales-history-table td:nth-child(4){width:8%}
.sales-history-table th:nth-child(5),.sales-history-table td:nth-child(5){width:5%}
.sales-history-table th:nth-child(6),.sales-history-table td:nth-child(6){width:7%}
.sales-history-table th:nth-child(7),.sales-history-table td:nth-child(7){width:6%}
.sales-history-table th:nth-child(8),.sales-history-table td:nth-child(8){width:7%}
.sales-history-table th:nth-child(9),.sales-history-table td:nth-child(9){width:10%}
.sales-history-table th:nth-child(10),.sales-history-table td:nth-child(10){width:12%;white-space:nowrap}
.sales-history-table td:nth-child(10) a,
.sales-history-table td:nth-child(10) .link-btn{display:inline-block}

.kpi-table td strong{font-size:18px}
.pagination{display:flex;gap:6px;align-items:center;justify-content:flex-end;margin-top:10px}
.pagination a,.pagination span{padding:6px 10px;border:1px solid #cbd5e1;background:#fff;border-radius:8px;font-size:12px;font-weight:700}
.pagination .active{background:linear-gradient(135deg,var(--primary),var(--primary-2));color:#fff;border-color:var(--primary)}

.alert{padding:10px 12px;border-radius:10px;margin:10px 0;font-weight:700}
.alert.warn{background:#ffedd5;color:#9a3412;border:1px solid #fed7aa}
.alert.danger{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}

.btn{background:linear-gradient(135deg,var(--primary),var(--primary-2));color:#fff;border:none;padding:8px 12px;border-radius:9px;cursor:pointer;font-weight:800;box-shadow:0 10px 18px rgba(37,99,235,.25);font-size:13px}
.btn:hover{filter:brightness(.98);text-decoration:none}
.btn-soft{background:#eff6ff;color:#1e3a8a;border:1px solid #bfdbfe;box-shadow:none}
.form-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.inline-form{display:flex;gap:8px;align-items:center}
.link-btn{background:none;border:none;color:var(--danger);cursor:pointer;padding:0;font:inherit;font-weight:700}

.modal{position:fixed;inset:0;background:rgba(2,6,23,.45);display:none;align-items:center;justify-content:center;z-index:50}
.modal.open{display:flex}
.modal-content{background:#fff;border-radius:16px;padding:16px;max-width:780px;width:95%;max-height:90vh;overflow:auto;border:1px solid var(--line);box-shadow:var(--shadow)}
.accordion{border:1px solid #dbe3ef;border-radius:12px;background:#fbfdff;margin-bottom:10px}
.accordion summary{list-style:none;cursor:pointer;padding:11px 12px;font-weight:800;color:#1e3a8a;display:flex;align-items:center;justify-content:space-between}
.accordion summary::-webkit-details-marker{display:none}
.accordion summary::after{content:'+';font-weight:900;color:#2563eb}
.accordion[open] summary::after{content:'−'}
.accordion-body{padding:0 12px 12px;border-top:1px solid #e2e8f0}
.stock-movement-grid{grid-template-columns:repeat(5,minmax(160px,1fr));align-items:end}
#targetFields{grid-column:1 / -1;display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:8px}
#targetFields label{margin:0}
.stock-movement-actions{grid-column:1 / -1;margin-top:2px}
.stock-movement-actions .btn{min-width:150px;width:auto}
.customer-dropdown{position:relative}
.customer-dropdown-list{display:none;position:absolute;left:0;right:0;top:100%;max-height:220px;overflow:auto;background:#fff;border:1px solid #cbd5e1;border-radius:10px;box-shadow:0 12px 20px rgba(15,23,42,.12);z-index:30;margin-top:4px}
.customer-dropdown.open .customer-dropdown-list{display:block}
.customer-option{display:block;width:100%;text-align:left;padding:8px 10px;border:none;background:#fff;cursor:pointer;font:inherit}
.customer-option:hover{background:#eff6ff}
.customer-option-empty{padding:8px 10px;color:#64748b;font-size:12px}
.easy-list{max-height:220px;overflow:auto;border:1px dashed #cbd5e1;border-radius:10px;padding:8px;background:#fff}
.shooting-filter-form{display:grid;gap:10px}
.shooting-filter-row{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr)) auto;gap:8px;align-items:end}
.shooting-filter-form label{min-width:0;margin:0}
.shooting-filter-form input,.shooting-filter-form select{min-width:0;width:100%}
.print-columns-wrap{grid-column:1/-1}
.print-columns-grid{display:flex;flex-wrap:wrap;gap:8px 14px}
.print-columns-grid label.checkbox{display:inline-flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;font-weight:700;line-height:1.2;white-space:nowrap;min-width:auto}
.print-columns-grid label.checkbox input[type="checkbox"]{margin:0;transform:translateY(0);min-width:auto !important;width:auto !important;padding:0}
.hour-dial{position:relative;width:240px;height:240px;margin:8px auto 0;border-radius:50%;background:#e5e7eb;border:1px solid #d1d5db}
.hour-dial button{position:absolute;width:34px;height:34px;border:none;background:transparent;color:#374151;border-radius:50%;font-weight:800;cursor:pointer;transform:translate(-50%,-50%)}
.hour-dial button.active{background:#3b82f6;color:#fff;box-shadow:0 4px 12px rgba(59,130,246,.35)}
.hour-dial .dial-center{position:absolute;left:50%;top:50%;width:84px;height:84px;border-radius:50%;background:#eef2ff;border:1px solid #c7d2fe;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;color:#1e3a8a;font-weight:800;font-size:13px}
.hour-dial .dial-hand{position:absolute;left:50%;top:50%;width:70px;height:2px;background:#3b82f6;transform-origin:0 50%;border-radius:2px}
.hour-note{font-size:11px;color:#64748b;margin-top:4px}
.shooting-actions{display:flex;gap:8px;justify-content:flex-start;align-items:center;flex-wrap:nowrap}
.shooting-actions .btn{height:38px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center;box-shadow:none}
@media (max-width:1024px){
  .shooting-filter-row{grid-template-columns:repeat(2,minmax(170px,1fr))}
  .shooting-actions{grid-column:1/-1}
}
@media (max-width:760px){
  .shooting-filter-row{grid-template-columns:1fr}
  .shooting-actions{flex-wrap:wrap}
  .print-columns-grid{gap:8px 10px}
}
#easySaleWizard .modal-content{max-width:1180px;width:96vw;overflow-x:hidden}
#easySaleWizard table{table-layout:fixed;width:100%}
#easySaleWizard th,#easySaleWizard td{padding:6px 6px}
#easySaleWizard .easy-row input,#easySaleWizard .easy-row select{width:100%;min-width:0}
#easyItemsTable th:nth-child(1),#easyItemsTable td:nth-child(1){width:34%}
#easyItemsTable th:nth-child(2),#easyItemsTable td:nth-child(2){width:9%}
#easyItemsTable th:nth-child(3),#easyItemsTable td:nth-child(3){width:13%}
#easyItemsTable th:nth-child(4),#easyItemsTable td:nth-child(4){width:17%}
#easyItemsTable th:nth-child(5),#easyItemsTable td:nth-child(5){width:12%}
#easyItemsTable th:nth-child(6),#easyItemsTable td:nth-child(6){width:15%}

.receipt-wrap{max-width:920px;margin:10px auto;background:#fff;border:1px solid #d1d5db;border-radius:12px;padding:16px}
.receipt-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.shooting-print{padding:10px}
.print-stock-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0 18px}
.print-stock-summary h4{margin:0 0 4px;font-size:12px;color:#111}
.summary-sheet th,.summary-sheet td{font-size:10.5px;padding:4px 5px}
.summary-sheet th:last-child,.summary-sheet td:last-child{width:58px;text-align:right}
.shooting-sheet{width:100%;border-collapse:collapse;border:1px solid #111 !important}
.shooting-sheet th,.shooting-sheet td{border:1px solid #111;padding:6px 5px;font-size:11px;white-space:normal;word-break:break-word}
.shooting-sheet th{background:#fff;color:#111;position:static}
.shooting-sheet tr:last-child td{border-bottom:1px solid #111 !important}
.shooting-bottom-line{width:100%;border-top:1px solid #111;margin-top:-1px}
.toast{position:fixed;right:18px;top:14px;z-index:1200;min-width:320px;max-width:560px;display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 14px;border-radius:12px;border:1px solid #dbeafe;background:#eff6ff;color:#1e3a8a;box-shadow:0 14px 28px rgba(15,23,42,.18);animation:toastIn .18s ease-out}
.toast-success{background:linear-gradient(135deg,#16a34a,#15803d);border-color:#15803d;color:#ffffff}
.toast-error{background:linear-gradient(135deg,#ef4444,#dc2626);border-color:#dc2626;color:#ffffff}
.toast-info{background:linear-gradient(135deg,#2563eb,#1d4ed8);border-color:#1d4ed8;color:#ffffff}
.toast-text{font-weight:800;line-height:1.4;font-size:14px}
.toast-close{border:none;background:rgba(255,255,255,.2);color:inherit;font-size:16px;font-weight:800;cursor:pointer;line-height:1;border-radius:8px;padding:2px 7px}
.toast.hide{opacity:0;transform:translateY(-6px);transition:.24s ease}
@keyframes toastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}

@media print {.sidebar,.topbar,.no-print{display:none!important}body{background:#fff}.main-area{padding:0}.receipt-wrap{border:none;box-shadow:none}.shooting-print{border:none;box-shadow:none;padding:0}.container{max-width:none}.card{border:none;box-shadow:none}}
@media (max-width:1200px){.sidebar{width:230px}.grid.two{grid-template-columns:1fr}}
@media (max-width:1366px){
  .sales-history-table{min-width:0;table-layout:fixed}
  .sales-history-table th,.sales-history-table td{font-size:11px;padding:7px 6px}
  .sales-history-table th:nth-child(1),.sales-history-table td:nth-child(1){width:6%}
  .sales-history-table th:nth-child(2),.sales-history-table td:nth-child(2){width:23%}
  .sales-history-table th:nth-child(3),.sales-history-table td:nth-child(3){width:16%}
  .sales-history-table th:nth-child(4),.sales-history-table td:nth-child(4){width:9%}
  .sales-history-table th:nth-child(5),.sales-history-table td:nth-child(5){width:5%}
  .sales-history-table th:nth-child(6),.sales-history-table td:nth-child(6){width:7%}
  .sales-history-table th:nth-child(7),.sales-history-table td:nth-child(7){width:7%}
  .sales-history-table th:nth-child(8),.sales-history-table td:nth-child(8){width:7%}
  .sales-history-table th:nth-child(9),.sales-history-table td:nth-child(9){width:10%}
  .sales-history-table th:nth-child(10),.sales-history-table td:nth-child(10){width:10%;white-space:normal;line-height:1.25}
}
@media (max-width:920px){.app-shell{display:block}.sidebar{width:100%;position:static;height:auto}.main-area{width:100%;padding:10px}.login-wrap{grid-template-columns:1fr;max-width:560px}.topbar{border-radius:12px}}
@media (max-width:640px){h2{font-size:23px}h3{font-size:17px}th,td{font-size:11px;padding:7px}.container{padding:0 2px}.card{padding:10px}}
