/*
 * NexAltis Admin – Premium Design System v3
 * Palette: #0052CC Primary · #06080A Bg · #111318 Sidebar · #1C1F2E Surface
 */

/* ── Tokens ───────────────────────────────────────── */
:root {
    --primary: #0052CC;
    --primary-hover: #0043a4;
    --primary-glow: rgba(0, 82, 204, 0.25);
    --primary-light: rgba(0, 82, 204, 0.1);

    --bg-main: #06080A;
    --bg-sidebar: #0D1017;
    --bg-surface: #1C1F2E;
    --bg-card: #161A26;
    --bg-hover: rgba(255, 255, 255, 0.04);

    --border: rgba(255, 255, 255, 0.08);
    --border-solid: #2A2D3E;

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #475569;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --violet: #8B5CF6;

    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);

    --sidebar-w: 260px;
    --topbar-h: 64px;
}

/* ── Reset ────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}


/* ══════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════ */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-main);
}


/* ══════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Decorative top accent line */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--violet));
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .logo img {
    height: 28px;
    filter: brightness(1.1);
}

.nav-section-label {
    padding: 16px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-solid) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-solid);
    border-radius: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.18s ease;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.nav-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    opacity: 0.8;
    transition: all 0.18s;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item:hover i {
    opacity: 1;
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active i {
    opacity: 1;
    color: var(--primary);
}

/* Active indicator bar */
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.07);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.3);
}


/* ══════════════════════════════════════════════════
   MAIN WRAPPER & TOPBAR
══════════════════════════════════════════════════ */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: rgba(6, 8, 10, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
}

.topbar-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.85);
    }
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--violet));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
}

/* ══════════════════════════════════════════════════
   CONTENT AREA
══════════════════════════════════════════════════ */
.content-body {
    padding: 28px 32px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* Alert bar */
.alert-bar:not(:empty) {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    animation: fadeIn 0.3s ease;
}

.alert-bar.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-bar.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ══════════════════════════════════════════════════
   TAB PANELS
══════════════════════════════════════════════════ */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ══════════════════════════════════════════════════
   MODULE HEADERS
══════════════════════════════════════════════════ */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.module-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.module-title p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 3px;
}

.module-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}


/* ══════════════════════════════════════════════════
   STATS GRID
══════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.09;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-info .label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    white-space: nowrap;
}

.stat-info .value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-trend {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    color: var(--success);
}


/* ══════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}


/* ══════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

table,
.data-table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 13px 20px;
    text-align: left;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 20px;
    font-size: 13.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    vertical-align: middle;
}

td strong {
    color: var(--text-primary);
    font-weight: 500;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.12s;
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}


/* ══════════════════════════════════════════════════
   STATUS PILLS
══════════════════════════════════════════════════ */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.status-pill::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.status-pill.success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.status-pill.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.status-pill.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.status-pill.info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.status-pill.neutral {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
}


/* ══════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12.5px;
    border-radius: var(--radius-xs);
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.18s;
}

.btn-sm:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    padding: 8px 16px;
    font-size: 13px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.18s;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
}


/* ══════════════════════════════════════════════════
   SEARCH BOX
══════════════════════════════════════════════════ */
.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.search-box input {
    width: 260px;
    background: var(--bg-surface);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-sm);
    padding: 9px 14px 9px 36px;
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-light);
}


/* ══════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 18px;
}

.form-group label,
.field label,
.sc-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control,
.cf-input,
select.form-control {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    appearance: none;
}

.form-control:focus,
.cf-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.cf-textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    resize: vertical;
    min-height: 80px;
}

.cf-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-full {
    margin-bottom: 16px;
}

.create-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    margin-bottom: 24px;
}


/* ══════════════════════════════════════════════════
   KANBAN
══════════════════════════════════════════════════ */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-col {
    min-width: 300px;
    flex: 1;
    background: rgba(28, 31, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 2px;
}

.kanban-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.kanban-count {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 1px 8px;
    border-radius: 99px;
    font-weight: 600;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 160px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: grab;
    transition: all 0.18s;
}

.kanban-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 82, 204, 0.18);
}

.kanban-card h4 {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.kanban-card .company {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.kanban-card .budget {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.kanban-card .meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}


/* ══════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-info {
    font-size: 13px;
    color: var(--text-muted);
}


/* ══════════════════════════════════════════════════
   FINANCE GRID
══════════════════════════════════════════════════ */
.finance-grid {
    display: grid;
    gap: 20px;
}

.finance-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}


/* ══════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════ */
.glass {
    backdrop-filter: blur(12px) saturate(180%);
    background: var(--bg-card);
}

.add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px dashed var(--border-solid);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12.5px;
    transition: all 0.18s;
    margin-top: 10px;
}

.add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.loading {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.loading::before {
    content: '⏳ ';
}

.field {
    margin-bottom: 14px;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-sm);
    padding: 9px 13px;
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--primary);
}

.space-y-4>*+* {
    margin-top: 16px;
}

.space-y-3>*+* {
    margin-top: 12px;
}

.space-y-6>*+* {
    margin-top: 24px;
}

.grid {
    display: grid;
}

/* Job list cards */
.job-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.job-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.job-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.job-card .meta {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.job-card .meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}


/* ══════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 20% 50%, rgba(0, 82, 204, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #06080A 0%, #0D0F15 100%);
    position: relative;
    overflow: hidden;
}

.login-card {
    width: 100%;
    max-width: 860px;
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.login-left {
    flex: 1;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-right {
    flex: 1;
    background: var(--bg-sidebar);
    padding: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.login-right::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 82, 204, 0.08) 0%, transparent 60%);
}

.err-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
}

/* ══════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════ */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-wrapper {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-body {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .login-right {
        display: none;
    }
}


/* ══════════════════════════════════════════════════
   LOGIN PAGE – Concept Match
══════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 20% 50%, rgba(0, 82, 204, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #06080A 0%, #0D1119 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 860px;
    display: flex;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
    background: transparent;
}

/* Left illustration panel */
.login-left {
    flex: 1.1;
    background: linear-gradient(145deg, #0a0f1e 0%, #0f1829 50%, #0a1020 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 82, 204, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 82, 204, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.login-left::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 82, 204, 0.18) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login-illustration-wrap {
    position: relative;
    z-index: 2;
    width: 220px;
    height: 220px;
}

.login-illustration-icons {
    position: relative;
    width: 100%;
    height: 100%;
}

.il-icon {
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: float-icon 4s ease-in-out infinite;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.il-lock {
    width: 72px;
    height: 72px;
    font-size: 28px;
    background: linear-gradient(135deg, #0052CC, #0043a4);
    color: #fff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 30px rgba(0, 82, 204, 0.5);
    z-index: 3;
    animation: float-lock 4s ease-in-out infinite;
}

.il-cloud1 {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    top: 4%;
    left: 38%;
    animation-delay: 0.5s;
}

.il-cloud2 {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    top: 20%;
    right: 0;
    animation-delay: 1s;
}

.il-gear {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    bottom: 15%;
    right: 5%;
    animation-delay: 1.5s;
}

.il-chart {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    bottom: 5%;
    left: 35%;
    animation-delay: 2s;
}

.il-shield {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    top: 20%;
    left: 0;
    animation-delay: 2.5s;
}

.il-code {
    background: rgba(0, 82, 204, 0.12);
    border: 1px solid rgba(0, 82, 204, 0.3);
    color: #60a5fa;
    bottom: 18%;
    left: 0;
    animation-delay: 3s;
}

@keyframes float-icon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes float-lock {

    0%,
    100% {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) translateY(0);
    }

    50% {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) translateY(-6px);
    }
}

/* Right form panel */
.login-right {
    flex: 1;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
}

.login-form-inner {
    width: 100%;
    max-width: 340px;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.login-field {
    margin-bottom: 16px;
}

.login-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.login-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-sm);
    padding: 12px 14px 12px 40px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.login-btn {
    width: 100%;
    height: 46px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.login-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.login-security-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.login-security-note strong {
    color: var(--text-secondary);
}

.err-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.err-msg::before {
    content: '⚠';
    font-size: 14px;
}

/* =========================================================================
   PREMIUM UI OVERHAUL & RESPONSIVENESS
========================================================================= */

/* PREMIUM MODIFICATIONS */
:root {
    --primary: #2563EB; /* Deepen primary to a more solid royal blue per common premium concepts */
    --primary-hover: #1D4ED8;
    --radius-md: 16px; /* Larger border radius for cards */
    --radius-lg: 24px;
    --bg-card: #131722; /* Slightly darker richer card background */
    --border: rgba(255, 255, 255, 0.05); /* Softer borders */
}

/* Glassmorphism overlay on Cards */
.card, .stat-card {
    background: linear-gradient(135deg, rgba(19, 23, 34, 0.95), rgba(19, 23, 34, 0.7));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover, .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(255, 255, 255, 0.08);
}

.content-body {
    padding: 32px 40px;
    max-width: 1600px; /* Better use of widescreen */
}

.module-title h2 {
    font-size: 28px;
    letter-spacing: -0.02em;
}

/* Forms */
.cf-input, .cf-textarea, .form-control, .search-box input {
    background: rgba(10, 12, 16, 0.5); /* Deeper inputs */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.cf-input:focus, .cf-textarea:focus, .form-control:focus, .search-box input:focus {
    border-color: var(--primary);
    background: rgba(10, 12, 16, 0.8);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* Buttons */
.btn {
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Sidebar Styling Premium Touch */
.sidebar {
    background: rgba(9, 11, 15, 0.95);
    backdrop-filter: blur(20px);
}
.nav-item {
    font-size: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin: 4px 12px;
}
.nav-item.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.05));
    border-right: 3px solid var(--primary);
}
.nav-item.active::before {
    display: none; /* Override old pseudo element */
}

/* Responsive Table */
.table-container {
    padding: 8px; /* Internal cushion */
}
th {
    background: transparent;
    font-size: 12px;
    color: var(--text-muted);
}
td {
    font-size: 14px;
}

/* =========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
========================================================================= */

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    margin-right: 16px;
}

.sidebar-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Main Layout Shifts */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0 !important;
        width: 100%;
    }
    .mobile-menu-btn {
        display: block;
    }
    
    .content-body {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-badge, .topbar-avatar {
        display: none; /* simplify topbar on mobile */
    }

    .topbar-title {
        font-size: 16px;
    }

    /* Grids & Forms */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-row, .grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .module-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .search-box input {
        width: 100%;
    }

    .card {
        padding: 16px;
    }
    
    /* Kanban Mobile Fix */
    .kanban-board {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .finance-grid {
        display: flex;
        flex-direction: column;
    }
    
    .login-right {
        padding: 40px 20px;
    }
}
