/* =========================================================
   PFS - Project Flow System
   Main Application Layout
   ========================================================= */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;

    --page-bg: #f4f7fb;
    --surface: #ffffff;
    --border: #e5e7eb;

    --text-primary: #172033;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;

    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;

    --radius: 12px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--page-bg);
    color: var(--text-primary);
}


/* =========================================================
   APPLICATION LAYOUT
   ========================================================= */

.app-layout {
    min-height: 100vh;
    display: flex;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;

    background: var(--sidebar-bg);
    color: #ffffff;

    display: flex;
    flex-direction: column;

    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    z-index: 1000;
}


/* BRAND */

.sidebar-brand {
    height: 82px;

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 0 22px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--primary);

    font-size: 20px;
}

.brand-name {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    margin-top: 2px;

    font-size: 11px;
    color: #94a3b8;
}


/* NAVIGATION */

.sidebar-nav {
    flex: 1;

    padding: 20px 14px;

    overflow-y: auto;
}

.nav-label {
    padding: 17px 12px 8px;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1.3px;
}

.nav-label:first-child {
    padding-top: 3px;
}

.nav-item {
    min-height: 45px;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 0 13px;
    margin: 3px 0;

    color: #cbd5e1;
    text-decoration: none;

    border-radius: 8px;

    font-size: 14px;
    font-weight: 500;

    transition: all 0.15s ease;
}

.nav-item i {
    width: 21px;

    text-align: center;

    font-size: 17px;
}

.nav-item:hover {
    color: #ffffff;
    background: var(--sidebar-hover);
}

.nav-item.active {
    color: #ffffff;
    background: var(--primary);
}


/* SIDEBAR FOOTER */

.sidebar-footer {
    padding: 18px 22px 21px;

    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.company-name {
    font-size: 12px;
    font-weight: 700;

    color: #e2e8f0;
}

.company-subtitle {
    margin-top: 4px;

    color: #64748b;

    font-size: 10px;
    line-height: 1.4;
}


/* =========================================================
   MAIN AREA
   ========================================================= */

.main-area {
    width: calc(100% - var(--sidebar-width));

    min-height: 100vh;

    margin-left: var(--sidebar-width);
}


/* =========================================================
   TOP BAR
   ========================================================= */

.topbar {
    height: 82px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

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

    padding: 0 30px;

    position: sticky;
    top: 0;

    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;

    gap: 14px;
}

.sidebar-toggle {
    display: none;

    border: 0;
    background: transparent;

    cursor: pointer;

    font-size: 24px;
}

.page-title {
    margin: 0;

    font-size: 21px;
    font-weight: 700;

    color: var(--text-primary);
}

.page-subtitle {
    margin-top: 4px;

    font-size: 12px;

    color: var(--text-secondary);
}


/* RIGHT SIDE */

.topbar-right {
    display: flex;
    align-items: center;

    gap: 17px;
}

.topbar-icon {
    width: 39px;
    height: 39px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: #ffffff;

    color: var(--text-secondary);

    cursor: pointer;

    font-size: 16px;
}

.topbar-icon:hover {
    background: #f8fafc;
    color: var(--text-primary);
}


/* USER */

.user-profile {
    display: flex;
    align-items: center;

    gap: 10px;
}

.user-avatar {
    width: 39px;
    height: 39px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #dbeafe;
    color: var(--primary);

    font-weight: 700;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    margin-top: 2px;

    color: var(--text-secondary);

    font-size: 11px;
}


/* =========================================================
   PAGE CONTENT
   ========================================================= */

.page-content {
    padding: 28px 30px 40px;
}


/* =========================================================
   COMMON COMPONENTS
   ========================================================= */

.card {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

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

    padding: 18px 20px;

    border-bottom: 1px solid var(--border);
}

.card-title {
    margin: 0;

    font-size: 15px;
    font-weight: 650;
}

.card-body {
    padding: 20px;
}


/* BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 38px;

    padding: 0 15px;

    border: 1px solid transparent;
    border-radius: 8px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    text-decoration: none;

    transition: 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #ffffff;
    border-color: var(--border);

    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #f8fafc;
}


/* TABLE */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;

    border-collapse: collapse;
}

.data-table th {
    padding: 12px 15px;

    background: #f8fafc;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 700;

    text-align: left;

    text-transform: uppercase;
    letter-spacing: 0.4px;

    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 15px;

    font-size: 13px;

    border-bottom: 1px solid #eef2f7;
}

.data-table tbody tr:hover {
    background: #fafcff;
}


/* BADGES */

.badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}


/* FORM CONTROLS */

.form-control {
    width: 100%;

    min-height: 40px;

    padding: 8px 11px;

    border: 1px solid #dbe1e8;
    border-radius: 8px;

    background: #ffffff;

    font-family: inherit;
    font-size: 13px;

    outline: none;
}

.form-control:focus {
    border-color: #93c5fd;

    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}


/* ALERTS */

.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 15px;

    background: #eff6ff;

    border: 1px solid #bfdbfe;
    border-radius: 8px;

    color: #1e40af;

    font-size: 13px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

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

    .main-area {
        width: 100%;
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .topbar {
        padding: 0 18px;
    }

    .page-content {
        padding: 20px 18px 30px;
    }

    .user-info {
        display: none;
    }
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-page {
    max-width: 1500px;
    margin: 0 auto;
}


/* Dashboard heading */

.dashboard-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 24px;
}

.dashboard-eyebrow {
    margin-bottom: 7px;

    color: var(--primary);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1px;
    text-transform: uppercase;
}

.dashboard-heading h2 {
    margin: 0;

    color: var(--text-primary);

    font-size: 26px;
    font-weight: 700;
}

.dashboard-heading p {
    margin: 7px 0 0;

    color: var(--text-secondary);

    font-size: 14px;
}

.dashboard-date {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 9px 13px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 9px;

    color: var(--text-secondary);

    font-size: 12px;

    box-shadow: var(--shadow);
}


/* =========================================================
   KPI CARDS
   ========================================================= */

.kpi-grid {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 24px;
}

.kpi-card {
    min-height: 125px;

    display: flex;
    align-items: center;

    gap: 16px;

    padding: 20px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);

    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.kpi-icon {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #eff6ff;
    color: var(--primary);

    font-size: 21px;
}

.kpi-card:nth-child(2) .kpi-icon {
    background: #f0fdf4;
    color: var(--success);
}

.kpi-card:nth-child(3) .kpi-icon {
    background: #fffbeb;
    color: var(--warning);
}

.kpi-card:nth-child(4) .kpi-icon {
    background: #f5f3ff;
    color: #7c3aed;
}

.kpi-label {
    margin-bottom: 5px;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 600;
}

.kpi-value {
    margin: 0;

    color: var(--text-primary);

    font-size: 27px;
    font-weight: 750;

    line-height: 1;
}

.kpi-description {
    margin-top: 6px;

    color: var(--text-muted);

    font-size: 11px;
}


/* =========================================================
   DASHBOARD COLUMNS
   ========================================================= */

.dashboard-columns {
    display: grid;

    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);

    gap: 20px;

    align-items: start;
}


/* =========================================================
   DASHBOARD PANEL
   ========================================================= */

.dashboard-panel {
    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;
}

.dashboard-panel-header {
    min-height: 67px;

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

    gap: 15px;

    padding: 16px 20px;

    border-bottom: 1px solid var(--border);
}

.dashboard-panel-title h3 {
    margin: 0;

    color: var(--text-primary);

    font-size: 15px;
    font-weight: 700;
}

.dashboard-panel-title p {
    margin: 5px 0 0;

    color: var(--text-secondary);

    font-size: 11px;
}

.dashboard-panel-link {
    color: var(--primary);

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;
}

.dashboard-panel-link:hover {
    text-decoration: underline;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    min-height: 260px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 35px;

    text-align: center;
}

.empty-state-icon {
    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 15px;

    border-radius: 50%;

    background: #f1f5f9;
    color: var(--text-secondary);

    font-size: 23px;
}

.empty-state h4 {
    margin: 0 0 7px;

    font-size: 14px;
    font-weight: 700;
}

.empty-state p {
    max-width: 360px;

    margin: 0;

    color: var(--text-secondary);

    font-size: 12px;

    line-height: 1.6;
}


/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.quick-actions {
    padding: 8px 0;
}

.quick-action {
    display: flex;
    align-items: center;

    gap: 13px;

    padding: 14px 18px;

    color: var(--text-primary);

    text-decoration: none;

    border-bottom: 1px solid #f1f5f9;

    transition: background 0.15s ease;
}

.quick-action:last-child {
    border-bottom: 0;
}

.quick-action:hover {
    background: #f8fafc;
}

.quick-action-icon {
    width: 37px;
    height: 37px;

    flex: 0 0 37px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: #eff6ff;
    color: var(--primary);

    font-size: 16px;
}

.quick-action-content {
    flex: 1;
    min-width: 0;
}

.quick-action-title {
    margin-bottom: 3px;

    font-size: 13px;
    font-weight: 650;
}

.quick-action-description {
    color: var(--text-secondary);

    font-size: 11px;
}

.quick-action-arrow {
    color: var(--text-muted);

    font-size: 15px;
}


/* =========================================================
   DASHBOARD RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 650px) {

    .dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-heading h2 {
        font-size: 22px;
    }
}


/* =========================================================
   COLLECTION NOTIFICATION BELL
========================================================= */

.notification-button {
    position: relative;
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;

    min-width: 20px;
    height: 20px;
    padding: 0 5px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;
    border: 2px solid #ffffff;

    background: #dc2626;
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Yellow bell when collection notifications exist */
.notification-button.has-notifications > i {
    color: #f59e0b;
}