/* ==========================================================
   GMC-Pro Stylesheet
   સ્વચ્છ, પ્રોફેશનલ, ગુજરાતી-ફ્રેન્ડલી
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #dbeafe;
    --accent: #0891b2;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --success: #16a34a;
    --warning: #ea580c;
    --danger: #dc2626;
    --info: #0891b2;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --font-gu: 'Noto Sans Gujarati', 'Noto Sans', sans-serif;
    --font-en: 'Inter', 'Noto Sans', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-gu);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* --------------------------- Nav --------------------------- */
.topnav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
}

.nav-brand:hover { text-decoration: none; }

.brand-mark-sm {
    background: var(--primary);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-family: var(--font-en);
    font-size: 13px;
    letter-spacing: 0.5px;
}

.brand-text strong { display: block; font-size: 15px; line-height: 1.1; }
.brand-text small { color: var(--text-muted); font-size: 11px; }

.nav-links { display: flex; gap: 4px; flex: 1; }

.nav-links a {
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    background: #f1f5f9;
    color: var(--text);
    text-decoration: none;
}

.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.pill {
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.nav-user { display: flex; align-items: center; gap: 10px; }

.user-chip {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: right;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.user-chip strong { font-size: 13px; }
.user-chip small { color: var(--text-muted); font-size: 11px; font-family: var(--font-en); }

.btn-logout {
    background: #fee2e2;
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-decoration: none;
}
.btn-logout:hover { background: var(--danger); color: #fff; text-decoration: none; }

/* --------------------------- Layout --------------------------- */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-head h1 { margin: 0 0 4px 0; font-size: 22px; font-weight: 600; }
.page-head p.subtitle { margin: 0; color: var(--text-muted); font-size: 14px; }

/* --------------------------- Cards --------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.card-head h3 { margin: 0; font-size: 16px; font-weight: 600; }

/* --------------------------- Stats --------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card .num { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-card .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.stat-card.ok .stat-icon { background: #dcfce7; }
.stat-card.warn .stat-icon { background: #fed7aa; }
.stat-card.danger .stat-icon { background: #fecaca; }
.stat-card.info .stat-icon { background: var(--primary-light); }

/* --------------------------- Tables --------------------------- */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table.data {
    width: 100%;
    border-collapse: collapse;
}

table.data th, table.data td {
    padding: 10px 14px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: top;
}

/* Re-align to left since Gujarati reads LTR */
table.data th, table.data td { text-align: left; }

table.data thead th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

table.data tbody tr:hover { background: #f8fafc; }
table.data tbody tr:last-child td { border-bottom: none; }

/* --------------------------- Buttons --------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text);
    border-radius: 6px;
    font-family: var(--font-gu);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.btn:hover { background: #f1f5f9; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-warn { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: flex; justify-content: center; width: 100%; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------- Forms --------------------------- */
form label {
    display: block;
    margin-bottom: 12px;
}

form label > span {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

input[type=text], input[type=password], input[type=email],
input[type=date], input[type=number], input[type=tel],
select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-family: var(--font-gu);
    font-size: 14px;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

textarea { min-height: 80px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

/* --------------------------- Alerts --------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    font-size: 14px;
}
.alert-ok { background: #dcfce7; border-color: #86efac; color: #166534; }
.alert-err { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.alert-warn { background: #fef3c7; border-color: #fcd34d; color: #854d0e; }
.alert-info { background: var(--primary-light); border-color: #93c5fd; color: #1e3a8a; }

/* --------------------------- Badges --------------------------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.2px;
}

.chip {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: #f1f5f9;
    color: var(--text-muted);
}

/* --------------------------- Login / Install --------------------------- */
.login-body, .install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    padding: 20px;
}
.login-card, .install-box {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}
.install-box { max-width: 560px; }

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    background: var(--primary);
    color: #fff;
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-en);
    font-size: 16px;
    letter-spacing: 1px;
}

.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 2px 0 0 0; font-size: 12px; color: var(--text-muted); }

.foot-note {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    margin-top: 20px;
    margin-bottom: 0;
}

.install-box h1 { margin-top: 0; }
.install-box .subtitle { color: var(--text-muted); margin-top: -8px; margin-bottom: 24px; }
.install-box h3 { margin-top: 20px; }
.install-box .warn { color: var(--warning); background: #fef3c7; padding: 10px; border-radius: 6px; font-size: 13px; }

/* --------------------------- Task Detail --------------------------- */
.task-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

@media (max-width: 900px) {
    .task-layout { grid-template-columns: 1fr; }
    .nav-inner { flex-wrap: wrap; padding: 10px 12px; }
    .nav-links { order: 3; flex-basis: 100%; overflow-x: auto; }
    .main { padding: 14px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

.task-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.meta-item {
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.meta-item .lbl { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.meta-item .val { font-weight: 500; margin-top: 2px; }

/* Stage tracker */
.stage-tracker {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    overflow-x: auto;
    margin-bottom: 16px;
}

.stage-step {
    flex: 1;
    min-width: 110px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 12px;
    text-align: center;
    position: relative;
}

.stage-step.done {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.stage-step.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.stage-step .num {
    font-size: 10px;
    font-family: var(--font-en);
    opacity: 0.7;
    display: block;
    margin-bottom: 2px;
}

/* Checklist */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}
.check-item:last-child { border-bottom: none; }
.check-item input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; cursor: pointer; }
.check-item label { margin: 0; cursor: pointer; flex: 1; }
.check-item.done label { text-decoration: line-through; color: var(--text-muted); }
.check-item .meta-small { font-size: 11px; color: var(--text-muted); }

/* Subtasks */
.subtask-list { list-style: none; padding: 0; margin: 0; }
.subtask-item {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.subtask-item:hover { background: #f8fafc; }
.subtask-title { flex: 1; font-size: 14px; }
.subtask-title a { color: var(--text); }

/* Chat */
.chat-box {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.chat-msg {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
}

.chat-msg .avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.chat-msg .bubble {
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex: 1;
}

.chat-msg.mine .bubble { background: var(--primary-light); border-color: #bfdbfe; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .avatar { background: var(--accent); }

.chat-msg .who { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.chat-msg .text { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.chat-msg .time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.chat-input { display: flex; gap: 8px; }
.chat-input textarea { min-height: 44px; flex: 1; }

/* Priority tint */
.tag-pri {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #fff;
    font-weight: 500;
}

/* Empty state */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 48px; opacity: 0.4; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.filter-bar select, .filter-bar input {
    padding: 6px 10px;
    font-size: 13px;
}

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a {
    padding: 10px 16px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }

/* Hierarchy tree */
.tree { list-style: none; padding-left: 20px; }
.tree > li { padding: 4px 0; border-left: 1px dashed var(--border-strong); padding-left: 12px; margin-left: 4px; }

/* English text uses Inter */
.en { font-family: var(--font-en); }

/* Utility */
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 10px; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 10px; }

/* =============================================================
   Additional UI components: page-header, modal, switch, notif-list, etc.
   ============================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-header h1 {
    margin: 0 0 4px;
    font-size: 1.6em;
    color: var(--text);
}
.page-header p { margin: 0; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}
.modal.show { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 12px;
    max-width: 680px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 24px;
    animation: modalIn 0.18s ease-out;
}
@keyframes modalIn {
    from { transform: translateY(-12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.modal-header h3 { margin: 0; color: var(--text); }
.btn-close {
    background: none;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 6px;
    text-decoration: none;
}
.btn-close:hover { color: var(--danger); }

/* Switch / toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    cursor: pointer;
    vertical-align: middle;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch span {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: 0.2s;
}
.switch span::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(20px); }

/* Role badges */
.badge-role-admin   { background: #7c2d12; color: #fff; }
.badge-role-manager { background: #1e40af; color: #fff; }
.badge-role-officer { background: #0891b2; color: #fff; }
.badge-role-staff   { background: #64748b; color: #fff; }
.badge-success      { background: #dcfce7; color: #166534; }
.badge-muted        { background: #f1f5f9; color: #64748b; }

/* Inactive user row */
.row-inactive { opacity: 0.55; }
.row-inactive input:not([type=submit]):not([type=button]) { background: #f8fafc; }

/* Inline checkbox label */
.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 8px;
}
.inline-check input { margin: 0; }

/* Priority badge preview */
.priority-badge {
    display: inline-block;
    padding: 4px 12px;
    color: #fff;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Notification list */
.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.notif-item {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread {
    background: #eff6ff;
    border-left: 3px solid var(--primary);
}
.notif-item.unread:hover { background: #dbeafe; }
.notif-item form {
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}
.notif-icon {
    font-size: 1.6em;
    line-height: 1;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    border: 1px solid var(--border);
}
.notif-msg {
    font-size: 0.95em;
    color: var(--text);
    margin-bottom: 3px;
}
.notif-meta { font-size: 0.82em; }
.notif-action { flex-shrink: 0; align-self: center; }

/* Empty state */
.empty-state {
    padding: 48px 24px;
    text-align: center;
}
.empty-state h3 {
    margin: 12px 0 6px;
    color: var(--text);
}
.empty-state p { margin: 0; }

/* Form fields inside data tables (for masters.php inline edit) */
.data-table input[type=text],
.data-table input[type=number],
.data-table input[type=color] {
    padding: 6px 8px;
    font-size: 0.9em;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 100%;
    background: #fff;
}
.data-table input[type=color] { padding: 2px; height: 32px; }
.data-table .nowrap { white-space: nowrap; }

/* Small button variant */
.btn-sm {
    padding: 5px 10px;
    font-size: 0.85em;
}

/* Requirement indicator */
.req { color: var(--danger); font-weight: bold; }

/* Form grid for modals & create forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 12px;
}
.form-field label {
    display: block;
    font-size: 0.88em;
    color: #475569;
    margin-bottom: 4px;
    font-weight: 500;
}
.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=password],
.form-field input[type=date],
.form-field input[type=number],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95em;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
.form-field input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: stretch; }
}

/* =============================================================
   Phase 2 additions: notification banner, admin dropdown
   ============================================================= */

.notif-banner {
    background: linear-gradient(90deg, #dbeafe, #eff6ff);
    border-bottom: 1px solid #93c5fd;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 0.94em;
    color: #1e3a8a;
    flex-wrap: wrap;
}
.notif-banner span { font-weight: 500; }

/* Admin dropdown in topnav */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px;
    padding: 6px 0;
    z-index: 100;
    margin-top: 4px;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92em;
    border-radius: 0;
    border: none;
}
.nav-dropdown-menu a:hover { background: #f1f5f9; color: var(--primary); }

/* Close dropdown on outside click — JS handles */

/* Small helper shown in smtp_settings */
.stat-grid .stat-card { text-align: center; padding: 16px; }
.stat-num { font-size: 2em; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.88em; color: #64748b; margin-top: 4px; }
/* Pagination buttons */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    margin: 24px 0;
    flex-wrap: wrap;
}
.pagination .btn { min-width: 36px; text-align: center; }
.pagination .muted { color: #94a3b8; padding: 0 4px; }

/* ============================================================
   ClickUp-style Subtask UI
   ============================================================ */
.subtask-head { display: flex; justify-content: space-between; align-items: center; }

.subtask-count-badge {
    background: #eff6ff;
    color: #1e40af;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.82em;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.subtask-progress {
    position: relative;
    background: #e2e8f0;
    border-radius: 999px;
    height: 8px;
    margin: 12px 0 16px;
    overflow: hidden;
}
.subtask-progress-bar {
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.subtask-progress-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 0.75em;
    color: #64748b;
    font-weight: 600;
}

.subtask-list-v2 {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}
.subtask-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #fff;
    transition: background 0.15s, border-color 0.15s;
}
.subtask-row:hover { background: #f8fafc; border-color: #cbd5e1; }
.subtask-row.is-done { background: #f0fdf4; border-color: #bbf7d0; opacity: 0.85; }
.subtask-row.is-done .subtask-title-text { text-decoration: line-through; color: #64748b; }

.subtask-check {
    width: 20px; height: 20px;
    cursor: pointer;
    accent-color: #1e40af;
    flex-shrink: 0;
}

.subtask-link {
    flex: 1; min-width: 0;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.subtask-link:hover { text-decoration: none; }

.subtask-title-text { font-weight: 500; color: #1e293b; font-size: 0.96em; }
.subtask-link:hover .subtask-title-text { color: #1e40af; text-decoration: underline; }

.subtask-meta {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}

.chip-mini {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.78em;
    white-space: nowrap;
}
.chip-mini.muted { color: #94a3b8; font-style: italic; }

.tag-pri-sm {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    color: #fff;
    font-weight: 600;
}

.subtask-del {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 1.1em;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.subtask-del:hover { background: #fee2e2; color: #dc2626; }

.subtask-addbar {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}
.subtask-addrow {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.subtask-addrow-icon { color: #64748b; font-size: 1.1em; }

.subtask-title-input {
    flex: 1; min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95em;
    background: #fff;
}
.subtask-title-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.1);
}
.subtask-assignee-select, .subtask-due-input {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.88em;
    background: #fff;
}
.subtask-assignee-select { min-width: 140px; }
.subtask-due-input { width: 140px; }

.subtask-addhint { font-size: 0.78em; color: #94a3b8; margin-top: 6px; }

@media (max-width: 768px) {
    .subtask-row { flex-wrap: wrap; padding: 10px; gap: 8px; }
    .subtask-link { order: 2; width: 100%; margin-top: 4px; }
    .subtask-check { order: 1; }
    .subtask-del { order: 3; margin-left: auto; }
    .subtask-meta { width: 100%; margin-left: 28px; }
    .subtask-addrow { flex-direction: column; align-items: stretch; }
    .subtask-addrow-icon { display: none; }
    .subtask-title-input, .subtask-assignee-select, .subtask-due-input {
        width: 100%; min-width: 0;
    }
}
