/* Kotha Academy Management System — hand written, no build step needed. */
:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --ink: #17233b;
    --muted: #6b7690;
    --line: #e3e8f2;
    --primary: #2457d6;
    --primary-d: #1b44ab;
    --green: #1f9d57;
    --orange: #e58a15;
    --red: #d6362f;
    --purple: #7a45d1;
    --side: #101a30;
    --side-ink: #dfe6f5;
    --side-link: #c5cfe6;
    --side-muted: #8e9bbb;
    --side-hover: rgba(255, 255, 255, .07);
    --side-line: rgba(255, 255, 255, .12);
    --font: 'Hind Siliguri';
    --fs: 15px;
    --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: var(--font), 'Hind Siliguri', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: var(--fs);
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
h1, h2 { margin: 0; }
h2 { font-size: 17px; margin-bottom: 12px; }
code { background: #eef2fb; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
pre { background: #f2f5fb; padding: 8px 10px; border-radius: 8px; overflow: auto; font-size: 12px; margin: 4px 0 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 24px; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; background: var(--side); color: var(--side-ink);
    display: flex; flex-direction: column; padding: 18px 14px;
    position: sticky; top: 0; height: 100vh; flex-shrink: 0; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; margin-bottom: 22px; color: var(--side-ink); }
.brand.big { color: var(--ink); justify-content: center; font-size: 20px; }
.brand-mark {
    background: var(--primary); color: #fff; width: 34px; height: 34px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a { color: var(--side-link); padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--side-hover); color: var(--side-ink); }
.nav a.active { background: var(--primary); color: #fff; }
.sidebar-foot { border-top: 1px solid var(--side-line); padding-top: 12px; }
.who { display: flex; flex-direction: column; margin-bottom: 10px; }
.who .muted { color: var(--side-muted); font-size: 13px; }
.main { flex: 1; min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 12px; padding: 14px 24px;
    background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 20px; flex: 1; }
.menu-btn { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink); }
.content { padding: 24px; max-width: 1200px; }
.lang { display: flex; gap: 4px; }
.lang a { padding: 4px 10px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); font-size: 13px; }
.lang a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 16px 0 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; }
.stat.green { border-left-color: var(--green); }
.stat.orange { border-left-color: var(--orange); }
.stat.purple { border-left-color: var(--purple); }
.stat-n { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat-l { color: var(--muted); }

/* buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
    color: var(--ink); font: inherit; font-weight: 500; cursor: pointer;
}
.btn:hover { background: #f1f4fb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.danger { background: #fff; border-color: #f1b9b6; color: var(--red); }
.btn.danger:hover { background: #fdeceb; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.disabled { opacity: .45; pointer-events: none; }
.sidebar .btn.ghost { background: transparent; color: var(--side-ink); border-color: var(--side-line); }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=date], input[type=time], input[type=datetime-local], input[type=url], input[type=tel], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #cfd7e8; border-radius: 9px;
    font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(36, 87, 214, .25); border-color: var(--primary); }
input:disabled { background: #f1f4fa; color: var(--muted); }
.err { color: var(--red); font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; margin: 4px 0 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 0 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: start; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* permissions */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 12px 0 18px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 12px; }
.perm-group legend { font-weight: 700; padding: 0 6px; color: var(--primary); }
.switch { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--primary); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8faff; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td input { min-width: 90px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { margin: 0; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; }
.card.filters { padding: 14px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }

.cat-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.cat-row:last-child { border-bottom: 0; }
.cat-form { display: flex; gap: 8px; flex: 1; min-width: 280px; }
.cat-form .narrow { width: 80px; }
.cat-row form { display: flex; gap: 8px; align-items: center; margin: 0; }

/* badges + alerts */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: #e2f6ea; color: var(--green); }
.badge.gray { background: #eceff5; color: var(--muted); }
.badge.orange { background: #fdf0dc; color: var(--orange); }
.badge.red { background: #fde7e6; color: var(--red); }
.badge.purple { background: #efe6fb; color: var(--purple); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.alert.ok { background: #e8f7ee; border-color: #bfe6cf; color: #146b3a; }
.alert.bad { background: #fdeceb; border-color: #f4c3c0; color: #9c231e; }
.alert.warn { background: #fff6e5; border-color: #f2d9a2; color: #7a4c05; }
.creds { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 0; }
.creds dt { font-weight: 600; }
.creds dd { margin: 0; }
.creds code { font-size: 15px; background: #fff; border: 1px solid #f2d9a2; }
details summary { cursor: pointer; color: var(--primary); font-size: 13px; }

/* login */
body.guest { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 400px; padding: 16px; }
.login { padding: 28px; }
.lang.center { justify-content: center; margin-bottom: 14px; }

@media (max-width: 860px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
    .menu-btn { display: block; }
    .content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .grid-2, .grid-3, .grid-4, .two-col { grid-template-columns: 1fr; }
}

/* ---- Phase 2: orders ---- */
.badge.blue { background: #e4ecfd; color: var(--primary); }
a.stat { color: inherit; }
a.stat:hover { box-shadow: 0 2px 10px rgba(23, 35, 59, .08); }
.stat.red { border-left-color: var(--red); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.filters.wrap { align-items: flex-end; }
.filters .inline { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.late { color: var(--red); font-weight: 600; }
.grid-3e { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.small { font-size: 13px; }
h3 { font-size: 15px; margin: 16px 0 6px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.facts { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0 0 8px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.prose { white-space: pre-wrap; margin: 0 0 8px; }
.prose.note { background: #fff8e8; border: 1px dashed #f0d79a; border-radius: 8px; padding: 10px 12px; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.file { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.file img, .file .ph, .preview img, .preview .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #eef2fb; }
.ph { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
.file-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 14px; }
.dropzone { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center; padding: 20px 12px; border: 2px dashed #bfcbe6; border-radius: 12px; background: #f8faff; cursor: pointer; }
.dropzone.over, .dropzone:hover { border-color: var(--primary); background: #eef3ff; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 8px; }
.preview { position: relative; font-size: 11px; }
.preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(23, 35, 59, .8); color: #fff; cursor: pointer; line-height: 1; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.timeline li { position: relative; }
.timeline li::before { content: ''; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.log-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.log-item:last-child { border-bottom: 0; }

@media (max-width: 860px) {
    .detail-grid, .grid-3e { grid-template-columns: 1fr; }
    .facts { grid-template-columns: 1fr; gap: 2px; }
    .facts dd { margin-bottom: 8px; }
}

/* ---- Phase 3-6 ---- */
.bell{position:relative;text-decoration:none;font-size:1.15rem;margin-left:auto;margin-right:.75rem}
.bell-n{position:absolute;top:-6px;right:-10px;background:#dc2626;color:#fff;border-radius:999px;font-size:.65rem;padding:1px 5px;font-weight:600}
.badge.purple{background:#ede9fe;color:#6d28d9}
.task-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;margin-bottom:1rem}
.task-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1rem;display:flex;flex-direction:column;gap:.5rem}
.task-card.emergency{border-color:#7c3aed;box-shadow:0 0 0 2px #ede9fe}
.task-card h3{margin:0;font-size:1rem}
.task-card .thumb{width:100%;height:130px;object-fit:cover;border-radius:8px;background:#f3f4f6}
.tabs{display:flex;gap:.4rem;flex-wrap:wrap;margin-bottom:1rem}
.tabs a{padding:.45rem .9rem;border-radius:999px;background:#eef2ff;color:#1e3a8a;text-decoration:none;font-size:.9rem}
.tabs a.on{background:#1d4ed8;color:#fff}
.bar{height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden}
.bar>span{display:block;height:100%;background:#1d4ed8}
.notice{border-left:4px solid #f59e0b;background:#fffbeb;padding:.75rem 1rem;border-radius:8px;margin-bottom:1rem}
.notice.purple{border-color:#7c3aed;background:#f5f3ff}
.unread{background:#eff6ff}
.num{text-align:right;font-variant-numeric:tabular-nums}
.compare{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
@media(max-width:720px){.compare{grid-template-columns:1fr}}
.btn.warn{background:#f59e0b;color:#fff}
textarea{width:100%;min-height:80px}
.perf-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem}
.perf-head{display:flex;gap:.75rem;align-items:center;margin-bottom:.6rem}
.light-box{display:flex;flex-direction:column;gap:3px;background:#1f2937;padding:5px;border-radius:10px}
.lamp{display:block;width:14px;height:14px;border-radius:50%;background:#4b5563}
.lamp.on-red{background:#ef4444;box-shadow:0 0 8px #ef4444}
.lamp.on-yellow{background:#facc15;box-shadow:0 0 8px #facc15}
.lamp.on-green{background:#22c55e;box-shadow:0 0 8px #22c55e}

/* Logo */
.brand-logo { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; flex: none; }
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo img { width: 190px; max-width: 70%; height: auto; }

/* inline assign on order page, appearance page */
.inline-assign { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.inline-assign select { flex: 1; min-width: 140px; padding: 6px 8px; }
.theme-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-preset { border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; background: var(--card); text-align: left; font: inherit; color: var(--ink); }
.theme-preset:hover { border-color: var(--primary); }
.theme-preset .sw { display: flex; gap: 4px; margin-bottom: 6px; }
.theme-preset .sw i { width: 22px; height: 22px; border-radius: 6px; display: block; border: 1px solid rgba(0, 0, 0, .08); }
.color-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.color-row input[type=color] { width: 100%; height: 42px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.theme-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; min-height: 150px; }
.theme-preview .pv-side { width: 150px; padding: 12px; }
.theme-preview .pv-main { flex: 1; padding: 14px; }
.theme-preview .pv-link { display: block; padding: 6px 8px; border-radius: 6px; margin-bottom: 4px; font-size: .9em; }
.topbar { border-bottom: 3px solid var(--accent, var(--line)); }
@media (max-width: 600px) {
    .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 10px 12px; }
    .stat-n { font-size: 22px; }
    .stat-l { font-size: 13px; }
}
/* customer approval page */
.proof-wrap { max-width: 760px; margin: 0 auto; padding: 18px 14px 40px; }
.proof-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.proof-head h1 { font-size: 1.35em; }
.proof-logo { width: 72px; height: auto; }
.proof-images { display: grid; gap: 12px; margin: 10px 0; }
.proof-images img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; display: block; }
.proof-msg { background: #eef6ff; border: 1px solid #cfe3fb; padding: 14px 16px; border-radius: var(--radius); margin: 10px 0; }
.proof-msg.ok { background: #ecf9f1; border-color: #bfe8cf; }
.proof-msg.warn { background: #fff4e5; border-color: #fbd9a8; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn.big { padding: 14px; font-size: 1.1em; }
.proof-changes { margin-top: 12px; }
.proof-changes summary { list-style: none; cursor: pointer; }
.proof-changes summary::-webkit-details-marker { display: none; }
.risk { border-left: 5px solid var(--line); }
.risk.good { border-left-color: var(--green); } .risk.watch { border-left-color: var(--orange); } .risk.high { border-left-color: var(--red); } .risk.new { border-left-color: var(--primary); }
.att-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
[hidden] { display: none !important; }
