/* =====================================================
   AXO-G CRM — Admin Panel Design System (Modernized)
   ===================================================== */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ── */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #e0e7ff;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --sidebar-w: 280px;
    --topbar-h: 70px;
    --bg: #f4f7fe;
    --card: rgba(255, 255, 255, 0.85);
    --border: rgba(226, 232, 240, 0.8);
    --border-light: rgba(241, 245, 249, 0.6);
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;
    --sidebar-bg: rgba(15, 23, 42, 0.85);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 0 25px rgba(79, 70, 229, 0.15);
    --transition: all .25s cubic-bezier(.4, 0, .2, 1);
    --transition-fast: all .15s cubic-bezier(.4, 0, .2, 1);
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0.03) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.03) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.03) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: 14px;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

/* ── Smooth scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(99, 102, 241, .12) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(139, 92, 246, .08) 0%, transparent 50%);
    animation: loginAmbient 20s ease-in-out infinite alternate;
}

@keyframes loginAmbient {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(2%, 2%) rotate(3deg);
    }
}

.login-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .25), 0 0 0 1px rgba(255, 255, 255, .05);
    animation: loginBoxIn .5s cubic-bezier(.4, 0, .2, 1);
}

@keyframes loginBoxIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo .brand {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-logo .sub {
    font-size: 12.5px;
    color: var(--text-2);
    margin-top: 6px;
    font-weight: 400;
}

.login-logo .divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    border-radius: 2px;
    margin: 14px auto 0;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    transition: var(--transition);
    background: #f9fafb;
}

.login-field input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .15), transparent);
    opacity: 0;
    transition: opacity .2s;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .35);
}

.login-btn:hover::before {
    opacity: 1;
}

.login-btn:active {
    transform: translateY(0) scale(.99);
}

.login-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertIn .3s ease;
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.login-alert.error {
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.login-alert.success {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #86efac;
    color: #15803d;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-3);
    font-weight: 400;
}

/* =====================================================
   SHELL LAYOUT
   ===================================================== */
.shell {
    display: flex;
    min-height: 100vh;
}

.shell-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.page-body {
    flex: 1;
    padding: 28px;
    min-width: 0;
    overflow-x: hidden;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .08);
    border-radius: 2px;
}

.sb-logo {
    padding: 24px 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sb-logo .brand {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -.3px;
}

.sb-logo .sub {
    font-size: 11px;
    color: rgba(255, 255, 255, .3);
    margin-top: 4px;
    font-weight: 400;
}

.sb-section {
    padding: 20px 22px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .22);
    text-transform: uppercase;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px;
    color: rgba(255, 255, 255, .55);
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.sb-item:hover {
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .9);
}

.sb-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, .2), rgba(99, 102, 241, .05));
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 600;
}

.sb-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(99, 102, 241, .6);
}

.sb-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sb-badge {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, .3);
}

.sb-caret {
    margin-left: auto;
    font-size: 11px;
    transition: transform .25s ease;
    color: rgba(255, 255, 255, .5);
}

.sb-item.open .sb-caret {
    transform: rotate(90deg);
}

.sb-sub {
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s cubic-bezier(.4, 0, .2, 1);
}

.sb-sub.open {
    max-height: 500px;
}

.sb-sub .sb-item {
    padding-left: 52px;
    font-size: 13px;
    color: rgba(255, 255, 255, .42);
}

.sb-sub .sb-item:hover {
    color: rgba(255, 255, 255, .85);
}

.sb-sub .sb-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99, 102, 241, .12), transparent);
}

.sb-footer {
    margin-top: auto;
    padding: 16px 22px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    font-size: 12px;
    color: rgba(255, 255, 255, .28);
}

.sb-footer strong {
    color: rgba(255, 255, 255, .5);
    font-weight: 600;
}

/* =====================================================
   TOPBAR
   ===================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 16px;
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.2px;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

.topbar-user {
    display: flex;
    flex-direction: column;
    font-size: 12.5px;
    line-height: 1.35;
}

.topbar-user .name {
    font-weight: 600;
    color: var(--text);
}

.topbar-user .role {
    color: var(--text-3);
    font-size: 11px;
    font-weight: 400;
}

.topbar-sep {
    width: 1px;
    height: 22px;
    background: var(--border);
}

.btn-new-lead {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(99, 102, 241, .2);
}

.btn-new-lead:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.btn-logout {
    padding: 7px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: var(--text-2);
    font-weight: 500;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* =====================================================
   BREADCRUMB
   ===================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 24px;
    font-weight: 500;
}

.breadcrumb a {
    color: var(--primary);
    transition: color .15s;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb .sep {
    color: var(--text-3);
    font-weight: 300;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.1px;
}

.card-body {
    padding: 22px;
}

/* =====================================================
   STAT CARDS
   ===================================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 22px;
    display: block;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, transparent);
    transition: background .3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:nth-child(1):hover::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.stat-card:nth-child(2):hover::before {
    background: linear-gradient(90deg, #eab308, #facc15);
}

.stat-card:nth-child(3):hover::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.stat-card:nth-child(4):hover::before {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.stat-card:nth-child(5):hover::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform .2s;
}

.stat-card:hover .stat-icon {
    transform: scale(1.05);
}

.ic-blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.ic-yellow {
    background: linear-gradient(135deg, #fef9c3, #fde68a);
}

.ic-green {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

.ic-red {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.ic-purple {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

.stat-val {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    letter-spacing: -.5px;
}

.stat-lbl {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.stat-sub {
    font-size: 11.5px;
    color: var(--text-3);
    margin-top: 4px;
    font-weight: 400;
}

/* =====================================================
   TABLE
   ===================================================== */
.tbl-wrap {
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tbl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-light);
}

.tbl-head-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.1px;
}

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

thead tr {
    background: linear-gradient(180deg, #f9fafb, #f3f4f6);
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 13.5px;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr.tr-click {
    cursor: pointer;
    transition: background .15s;
}

tbody tr.tr-click:hover td {
    background: #f8fafc;
}

tbody tr.tr-urgent td {
    background: linear-gradient(90deg, #fffbeb, #fff);
}

tbody tr.tr-urgent:hover td {
    background: linear-gradient(90deg, #fef3c7, #fffbeb);
}

tbody tr.tr-medium td {
    background: linear-gradient(90deg, #eff6ff, #fff);
}

tbody tr.tr-medium:hover td {
    background: linear-gradient(90deg, #dbeafe, #eff6ff);
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .02em;
    transition: transform .15s;
}

.badge:hover {
    transform: scale(1.03);
}

.b-HOT {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.b-WARM {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #9a3412;
}

.b-COLD {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.b-URGENT {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.b-MEDIUM {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.b-LONG_TERM {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.b-UNASSIGNED {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
}

.b-ASSIGNED {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.b-NOT_INTERESTED {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.b-CANCELLED {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #334155;
}

.b-POSTPONED {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #9a3412;
}

.b-WORK_STARTED {
    background: linear-gradient(135deg, #cffafe, #a5f3fc);
    color: #083344;
}

.b-SITE_FINAL {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
}

/* =====================================================
   STATUS TABS
   ===================================================== */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tab {
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text-2);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.tab.on {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

.tab .cnt {
    background: rgba(0, 0, 0, .08);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 10.5px;
    font-weight: 700;
}

.tab.on .cnt {
    background: rgba(255, 255, 255, .25);
}

/* =====================================================
   FILTERS BAR
   ===================================================== */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.search-wrap .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-3);
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 13.5px;
    transition: var(--transition);
}

.search-wrap input::placeholder {
    color: var(--text-3);
}

.search-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.f-select {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    min-width: 140px;
    font-size: 13.5px;
}

.f-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, .35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: #cbd5e1;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, .2);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, .35);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, .2);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(34, 197, 94, .35);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 12.5px;
}

/* Table action buttons */
.act {
    display: flex;
    gap: 5px;
}

.act-btn {
    padding: 5px 12px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

.act-view {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
}

.act-status {
    background: linear-gradient(135deg, #fef9c3, #fde68a);
    color: #854d0e;
}

.act-assign {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
}

.act-view:hover {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    transform: translateY(-1px);
}

.act-status:hover {
    background: linear-gradient(135deg, #fde68a, #fcd34d);
    transform: translateY(-1px);
}

.act-assign:hover {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    transform: translateY(-1px);
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    padding: 16px 18px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
}

.pg-info {
    color: var(--text-2);
    margin-right: auto;
    font-size: 12.5px;
    font-weight: 500;
}

.pg-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    background: var(--card);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.pg-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.pg-btn.on {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(99, 102, 241, .25);
}

.pg-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* =====================================================
   FORM
   ===================================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.form-grid.g3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-full {
    grid-column: 1 / -1;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: .02em;
}

.form-label.req::after {
    content: ' *';
    color: #ef4444;
}

.form-input {
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    transition: var(--transition);
    width: 100%;
    font-size: 13.5px;
}

.form-input::placeholder {
    color: var(--text-3);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-input.err {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .08);
}

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

.form-err {
    font-size: 12px;
    color: #ef4444;
    font-weight: 500;
}

.form-hint {
    font-size: 12px;
    color: var(--text-3);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 10px;
}

/* Section labels inside forms */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-3);
    margin: 0 0 14px;
    padding-top: 4px;
}

/* Checkbox wrapper */
.chk-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-2);
}

.chk-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Alert box inside form */
.form-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertIn .3s ease;
}

.form-alert.err {
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-bg {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s cubic-bezier(.4, 0, .2, 1);
}

.modal-bg.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--card);
    border-radius: 16px;
    width: 520px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px) scale(.97);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}

.modal-bg.show .modal {
    transform: none;
}

.modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.1px;
}

.modal-x {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text-2);
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-x:hover {
    background: var(--border);
    color: var(--text);
}

.modal-bd {
    padding: 22px 24px;
}

.modal-ft {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =====================================================
   DETAIL PAGE
   ===================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
}

.info-list {}

.info-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.info-item:last-child {
    border-bottom: none;
}

.info-key {
    width: 160px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
}

.info-val {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

/* Timeline */
.timeline {
    padding-left: 24px;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--border));
    border-radius: 1px;
}

.tl-item {
    position: relative;
    padding-bottom: 22px;
}

.tl-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary), 0 0 8px rgba(99, 102, 241, .3);
}

.tl-text {
    font-size: 13px;
    font-weight: 600;
}

.tl-meta {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 3px;
}

/* =====================================================
   TOAST
   ===================================================== */
#toasts {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    color: #fff;
    animation: toastIn .3s cubic-bezier(.4, 0, .2, 1);
    backdrop-filter: blur(8px);
}

.toast-ok {
    background: linear-gradient(135deg, #166534, #15803d);
}

.toast-err {
    background: linear-gradient(135deg, #991b1b, #b91c1c);
}

.toast-warn {
    background: linear-gradient(135deg, #854d0e, #a16207);
}

.toast-info {
    background: linear-gradient(135deg, #1e293b, #334155);
}

@keyframes toastIn {
    from {
        transform: translateX(100%) scale(.9);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

/* =====================================================
   UTILITIES
   ===================================================== */
.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.fw {
    font-weight: 700;
}

.muted {
    color: var(--text-2);
}

.small {
    font-size: 12px;
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 {
    gap: 6px;
}

.gap-2 {
    gap: 12px;
}

.spin-wrap {
    text-align: center;
    padding: 48px 0;
    color: var(--text-2);
}

.spin {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-2);
}

.empty-icon {
    font-size: 44px;
    margin-bottom: 14px;
    opacity: .45;
}

/* =====================================================
   PAGE TITLE (for matching engine etc.)
   ===================================================== */
.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.3px;
}

/* =====================================================
   RESPONSIVE (basic)
   ===================================================== */
.stats-row {
    grid-template-columns: repeat(5, 1fr);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: var(--transition);
}

body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
}

.topbar-logo-wrap {
    display: none;
}

.topbar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 1024px) {
    .btn-menu-toggle {
        display: block !important;
    }
    
    .topbar-logo-wrap {
        display: block;
    }
    
    .stats-row {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .detail-grid {
        grid-template-columns: 1fr !important;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    :root {
        --sidebar-w: 70px;
    }

    .sidebar {
        width: var(--sidebar-w);
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-x: hidden;
    }

    .sidebar .sb-logo {
        display: none !important;
    }

    .sidebar .sb-section,
    .sidebar .badge {
        display: none !important;
    }

    .sidebar .sb-item {
        font-size: 0;
        justify-content: center;
        padding: 16px 0;
    }

    .sidebar .sb-item svg {
        margin-right: 0;
    }
    
    body.sidebar-open .sidebar {
        width: 280px;
    }
    
    body.sidebar-open .sidebar .sb-logo {
        display: flex !important;
    }
    
    body.sidebar-open .sidebar .sb-section,
    body.sidebar-open .sidebar .badge {
        display: block !important;
    }
    
    body.sidebar-open .sidebar .sb-item {
        font-size: 14px;
        justify-content: flex-start;
        padding: 12px 20px;
    }
    
    body.sidebar-open .sidebar .sb-item svg {
        margin-right: 12px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .page-body {
        padding: 16px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .profile-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr !important;
    }
}

/* =====================================================
   ADDITIONAL UTILITIES
   ===================================================== */
.tbl-wrap {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* =====================================================
   MOBILE TABS (Phase 2)
   ===================================================== */
.mobile-tabs-nav {
    display: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
}

.mobile-tabs-nav::-webkit-scrollbar {
    display: none;
}

.mobile-tab-btn {
    padding: 12px 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-3);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

@media (max-width: 768px) {
    .mobile-tabs-nav {
        display: flex;
    }
    
    .mobile-tab-pane {
        display: none;
    }
    
    .mobile-tab-pane.active {
        display: block;
    }
}

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

.tbl-wrap th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-light);
}

.tbl-wrap td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-key {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-val {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.section-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}