/* ============================================================
   Sckooly Admin - Design System
   Brand: ink charcoal (#1B1D1D) + Sckooly red (#DA251D)
   ============================================================ */

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

:root {
    /* Brand */
    --brand-ink: #1B1D1D;
    --brand-ink-soft: #2B2E2E;
    --brand-red: #DA251D;
    --brand-red-hover: #B81B15;
    --brand-red-soft: #FDF0EF;
    --brand-red-ring: rgba(218, 37, 29, 0.18);

    /* Semantic */
    --primary: #DA251D;
    --primary-hover: #B81B15;
    --primary-soft: #FDF0EF;

    /* Surfaces */
    --bg-body: #F6F6F5;
    --bg-surface: #FFFFFF;
    --bg-subtle: #FAFAF9;
    --bg-inset: #F2F2F1;

    /* Sidebar (dark) */
    --sidebar-bg: #1B1D1D;
    --sidebar-fg: #9EA3A3;
    --sidebar-fg-active: #FFFFFF;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(255, 255, 255, 0.09);
    --sidebar-border: rgba(255, 255, 255, 0.08);

    /* Text */
    --text-main: #15171A;
    --text-primary: #15171A;
    --text: #15171A;
    --text-secondary: #4B5157;
    --text-muted: #767C83;
    --text-faint: #9AA0A6;

    /* Lines */
    --border: #E6E6E4;
    --border-strong: #D6D6D3;

    /* Status */
    --danger: #DA251D;
    --danger-soft: #FDF0EF;
    --success: #157F5B;
    --success-soft: #EAF6F1;
    --warning: #B4700B;
    --warning-soft: #FDF4E6;
    --info: #2C5FD1;
    --info-soft: #EEF3FE;

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 22px;
    --radius-full: 9999px;

    /* Elevation: deliberately flat. The design uses hairline borders and tonal
       surfaces for separation instead of drop shadows. Tokens are kept (and
       resolved to `none`) so any rule still referencing them stays flat. */
    --shadow-xs: none;
    --shadow-sm: none;
    --shadow: none;
    --shadow-md: none;
    --shadow-lg: none;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -0.021em;
    font-weight: 650;
    color: var(--text-main);
}

a {
    color: inherit;
}

::selection {
    background: var(--brand-red-ring);
}

:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #D6D6D3;
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: #B9B9B5;
    background-clip: content-box;
}

/* ===================== Utilities ===================== */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.h-screen {
    height: 100vh;
}

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

.text-sm {
    font-size: 0.8125rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-bold {
    font-weight: 650;
}

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

.tabular {
    font-variant-numeric: tabular-nums;
}

/* ===================== Buttons ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    line-height: 1.25;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease),
        color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.12s var(--ease);
}

.btn:active {
    transform: translateY(0.5px);
}

.btn ion-icon,
.btn svg {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--brand-red);
    color: #fff;
    box-shadow: none;
}

.btn-primary:hover {
    background-color: var(--brand-red-hover);
}

.btn-ink {
    background-color: var(--brand-ink);
    color: #fff;
    box-shadow: none;
}

.btn-ink:hover {
    background-color: var(--brand-ink-soft);
}

.btn-outline {
    background-color: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
    border-color: var(--border-strong);
    background-color: var(--bg-subtle);
    color: var(--text-main);
}

.btn-ghost {
    background-color: transparent;
    border-color: transparent;
    color: var(--text-secondary);
    box-shadow: none;
}

.btn-ghost:hover {
    background-color: var(--bg-inset);
    color: var(--text-main);
}

.btn-success {
    background-color: var(--success);
    color: #fff;
    border-color: transparent;
}

.btn-success:hover {
    background-color: #10684A;
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
    border-color: transparent;
}

.btn-danger:hover {
    background-color: var(--brand-red-hover);
}

.btn-sm {
    padding: 0.4375rem 0.8125rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.8125rem 1.5rem;
    font-size: 0.9375rem;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.18s var(--ease);
}

.icon-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
    border-color: var(--border-strong);
}

/* ===================== Inputs ===================== */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.6875rem 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
    outline: none;
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--brand-red-ring);
    outline: none;
}

label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===================== Cards ===================== */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.375rem;
    box-shadow: var(--shadow-sm);
}

.card-flush {
    padding: 0;
    overflow: hidden;
}

/* ===================== Layout ===================== */
.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.sidebar {
    width: 256px;
    flex-shrink: 0;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-fg);
    padding: 1.5rem 0.875rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

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

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    background-clip: content-box;
    border-radius: 3px;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: calc(100% - 256px);
    max-width: calc(100% - 256px);
    margin-left: 256px;
    overflow-x: clip;
}

.content-wrapper {
    padding: 1.75rem 2rem 3rem;
    max-width: 1560px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Mobile Drawer & Hamburger Button Base Styles */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-main);
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s ease;
}

.mobile-menu-btn:hover {
    background: var(--bg-inset);
    border-color: var(--border-strong);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    transition: background-color 0.18s var(--ease);
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-backdrop {
    display: none;
}

body.sidebar-drawer-open {
    overflow: hidden !important;
}

/* ===================== Sidebar ===================== */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.25rem 0 1.75rem;
    padding: 0 0.625rem;
}

.logo-img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: contain;
    background: transparent;
}

.brand-name {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.1;
}

.brand-sub {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
    margin-top: 1px;
}

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
    padding: 0 0.75rem;
    margin: 1.25rem 0 0.5rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--sidebar-fg);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: -0.008em;
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-link svg,
.nav-link ion-icon {
    width: 19px;
    height: 19px;
    font-size: 19px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #E9EBEB;
}

.nav-link.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-fg-active);
    font-weight: 600;
}

.nav-link.active svg,
.nav-link.active ion-icon {
    opacity: 1;
    color: var(--brand-red);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-footer .nav-link {
    color: rgba(255, 255, 255, 0.55);
}

.sidebar-footer .nav-link:hover {
    background-color: rgba(218, 37, 29, 0.14);
    color: #FF8A84;
}

/* ===================== Top header ===================== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 2rem;
    min-height: 68px;
    background-color: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.header-title-container {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.page-title {
    font-size: 1.125rem;
    font-weight: 650;
    letter-spacing: -0.022em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
    min-width: 0;
}

.page-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 450;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-divider {
    width: 1px;
    height: 26px;
    background-color: var(--border);
    flex-shrink: 0;
}

.notif-btn {
    position: relative;
}

.notif-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-red);
    border: 2px solid var(--bg-surface);
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: opacity 0.15s ease;
}

.user-profile-btn:hover {
    opacity: 0.85;
}

.user-profile-btn:hover .user-meta-name {
    color: var(--brand-red);
}

.notif-panel-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 330px;
    max-width: calc(100vw - 24px);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    z-index: 1050;
    overflow: hidden;
    animation: notifFadeIn 0.18s ease-out;
}

@keyframes notifFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-inset);
}

.notif-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
}

.notif-panel-title svg {
    color: var(--brand-red);
}

.notif-panel-close {
    background: transparent;
    border: none;
    padding: 0.25rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
}

.notif-panel-close:hover {
    color: var(--text-main);
}

.notif-panel-body {
    padding: 1.5rem 1.25rem;
}

.notif-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.notif-empty-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-inset);
    border: 1px dashed var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 0.875rem;
}

.notif-empty-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.notif-empty-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
}

@media (max-width: 640px) {
    .notif-panel-dropdown {
        position: fixed;
        top: 62px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--brand-ink) 0%, #3A3D3D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 650;
    font-size: 0.875rem;
    flex-shrink: 0;
    box-shadow: none;
}

.user-meta-name {
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.user-meta-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ===================== Section headers ===================== */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0 1rem;
}

.section-header:first-child {
    margin-top: 0;
}

.section-title {
    font-size: 0.9375rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    color: var(--text-main);
}

.section-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===================== Tables ===================== */
.table-container {
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.card .table-container {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    text-align: left;
    padding: 0.8125rem 1.25rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

thead th:first-child {
    border-top-left-radius: var(--radius-xl);
}

thead th:last-child {
    border-top-right-radius: var(--radius-xl);
}

td {
    padding: 0.9375rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
    vertical-align: middle;
}

tbody tr {
    transition: background-color 0.14s var(--ease);
}

tbody tr:hover {
    background-color: var(--bg-subtle);
}

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

.empty-state {
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state ion-icon {
    font-size: 2.25rem;
    color: var(--text-faint);
    margin-bottom: 0.625rem;
}

.empty-state-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* ===================== Badges ===================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.45;
    white-space: nowrap;
    border: none;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge-pending {
    background-color: var(--warning-soft);
    color: var(--warning);
    border: none;
}

.badge-approved {
    background-color: var(--success-soft);
    color: var(--success);
    border: none;
}

.badge-rejected {
    background-color: var(--danger-soft);
    color: var(--danger);
    border: none;
}

.badge-neutral {
    background-color: var(--bg-inset);
    color: var(--text-muted);
    border: none;
}

/* Global rule: all badges and tags on all pages void of borders */
.badge,
.badge-pending,
.badge-approved,
.badge-rejected,
.badge-neutral,
.badge-equity,
.tag,
.tag-master,
.payment-status-badge,
.priority-badge,
.deadline-badge,
.todo-tag,
.status-badge {
    border: none !important;
}

/* ===================== Stats ===================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.stat-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.375rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.24s var(--ease), transform 0.24s var(--ease), border-color 0.24s var(--ease);
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-red), rgba(218, 37, 29, 0));
    opacity: 0;
    transition: opacity 0.24s var(--ease);
}

.stat-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-subtle);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    margin-top: 0.375rem;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.wallet-value {
    font-size: 1.625rem !important;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.stat-icon ion-icon {
    font-size: 1.25rem;
}

.stat-icon-blue {
    background: var(--bg-inset);
    color: var(--brand-ink);
    border-color: var(--border);
}

.stat-icon-purple {
    background: var(--bg-inset);
    color: var(--brand-ink);
    border-color: var(--border);
}

.stat-icon-green {
    background: var(--bg-inset);
    color: var(--brand-ink);
    border-color: var(--border);
}

.stat-icon-orange {
    background: var(--brand-red-soft);
    color: var(--brand-red);
    border-color: rgba(218, 37, 29, 0.14);
}

.stat-foot {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===================== Charts ===================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 1100px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    padding: 1.375rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.24s var(--ease), border-color 0.24s var(--ease);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-card:hover {
    border-color: var(--border-strong);
}

.chart-header {
    margin-bottom: 1.25rem;
}

.chart-title {
    font-size: 0.9375rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    color: var(--text-main);
    margin-bottom: 2px;
}

.chart-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.chart-container {
    height: 280px;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.chart-container-pie {
    height: 262px;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

canvas {
    max-width: 100% !important;
}

/* ===================== Dialogs ===================== */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(21, 23, 26, 0.44);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.18s var(--ease);
}

.dialog-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 1.75rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s var(--ease);
}

.dialog-icon-wrapper {
    margin-bottom: 0.875rem;
    font-size: 2.25rem;
    display: flex;
    justify-content: center;
}

.dialog-title {
    font-size: 1.0625rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
    color: var(--text-main);
}

.dialog-message {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.55;
}

.dialog-actions {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
}

.dialog-actions .btn {
    min-width: 104px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.97) translateY(6px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ===================== Detail pages ===================== */
.details-grid {
    display: grid;
    gap: 1rem;
}

.details-card,
.info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.375rem;
    box-shadow: var(--shadow-sm);
}

.details-header,
.info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border);
}

.details-header h2,
.info-title {
    font-size: 0.9375rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    color: var(--text-main);
    margin: 0;
}

.info-label,
.data-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.info-value,
.data-value {
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
}

/* ===================== Misc ===================== */
.divider {
    height: 1px;
    background: var(--border);
    border: none;
    margin: 1.25rem 0;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.search-field {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.search-field ion-icon {
    position: absolute;
    left: 0.8125rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 1.0625rem;
    pointer-events: none;
}

.search-field .input {
    padding-left: 2.375rem;
}

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: inline-flex;
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 17, 19, 0.62);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(300px, 86vw);
        max-width: 86vw;
        height: 100vh;
        height: 100dvh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.26s ease;
        box-shadow: none;
        padding: 1.25rem 1rem;
        display: flex;
        flex-direction: column;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
    }

    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    .content-wrapper,
    .top-header {
        padding-left: 1.125rem;
        padding-right: 1.125rem;
    }

    .top-header .page-subtitle {
        display: none !important;
    }

    .user-meta {
        display: none;
    }
}


/* ===================== Sidebar: badges and identity ===================== */
.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--brand-red);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background-color 0.18s var(--ease);
    min-width: 0;
}

.sidebar-user:hover {
    background-color: var(--sidebar-hover);
}

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 650;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    color: #E9EBEB;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
}

/* ===================== Status tabs ===================== */
.status-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    overflow-x: auto;
    width: fit-content;
    max-width: 100%;
}

.status-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.4375rem 0.8125rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.status-tab:hover {
    color: var(--text-main);
}

.status-tab.active {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.status-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 0.6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.status-tab.active .status-tab-count {
    background: var(--brand-ink);
    border-color: var(--brand-ink);
    color: #fff;
}

.status-tab.active.tone-pending .status-tab-count {
    background: var(--warning);
    border-color: var(--warning);
}

.status-tab.active.tone-approved .status-tab-count {
    background: var(--success);
    border-color: var(--success);
}

.status-tab.active.tone-rejected .status-tab-count {
    background: var(--danger);
    border-color: var(--danger);
}

/* ===================== Dashboard review queue ===================== */
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.review-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.125rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.review-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-subtle);
}

.review-card.has-items {
    border-color: rgba(180, 112, 11, 0.3);
    background: var(--warning-soft);
}

.review-card.has-items:hover {
    border-color: rgba(180, 112, 11, 0.5);
}

.review-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1875rem;
    flex-shrink: 0;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.review-card.has-items .review-icon {
    background: #fff;
    border-color: rgba(180, 112, 11, 0.24);
    color: var(--warning);
}

.review-count {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    color: var(--text-main);
}

.review-card.has-items .review-count {
    color: var(--warning);
}

.review-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 2px;
}

.review-go {
    margin-left: auto;
    color: var(--text-faint);
    font-size: 1.125rem;
    flex-shrink: 0;
}

/* ===================== Submissions & document workflow ===================== */
.reject-reason {
    display: flex;
    align-items: flex-start;
    gap: 0.4375rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: var(--danger-soft);
    border: 1px solid rgba(218, 37, 29, 0.18);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--danger);
}

.reject-reason ion-icon {
    flex-shrink: 0;
    font-size: 0.9375rem;
    margin-top: 1px;
}

.doc-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    background: var(--bg-subtle);
}

.doc-item + .doc-item {
    margin-top: 0.625rem;
}

.doc-item-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.doc-item-title {
    font-weight: 650;
    font-size: 0.875rem;
    color: var(--text-main);
}

.doc-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.doc-item-actions {
    display: flex;
    gap: 0.4375rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.doc-steps {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.doc-steps-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.doc-steps ol {
    margin: 0 0 0.75rem 1rem;
    padding: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.inline-upload {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline-upload input[type="file"] {
    flex: 1;
    min-width: 200px;
    padding: 0.4375rem 0.625rem;
    font-size: 0.75rem;
}

/* Outstanding actions on the profile dashboard */
.action-list {
    display: grid;
    gap: 0.625rem;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(180, 112, 11, 0.28);
    background: var(--warning-soft);
    text-decoration: none;
}

.action-item.tone-rejected {
    border-color: rgba(218, 37, 29, 0.24);
    background: var(--danger-soft);
}

.action-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(180, 112, 11, 0.24);
    color: var(--warning);
    flex-shrink: 0;
}

.action-item.tone-rejected .action-item-icon {
    border-color: rgba(218, 37, 29, 0.24);
    color: var(--danger);
}

.action-item-label {
    font-weight: 650;
    font-size: 0.875rem;
    color: var(--text-main);
}

.action-item-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.all-clear {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(21, 127, 91, 0.2);
    background: var(--success-soft);
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Sample CV modal */
.sample-modal {
    position: fixed;
    inset: 0;
    background: rgba(21, 23, 26, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 1200;
}

.sample-modal.active {
    display: flex;
}

.sample-sheet {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sample-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid var(--border);
}

.sample-body {
    padding: 1.375rem;
    overflow-y: auto;
}

.cv-sheet {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    background: #fff;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.cv-sheet h4 {
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.125rem;
}

.cv-sheet .cv-contact {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.cv-sheet h5 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-red);
    margin: 1rem 0 0.375rem;
}

.cv-sheet ul {
    margin: 0.25rem 0 0 1.125rem;
    padding: 0;
}

.cv-highlight {
    background: var(--brand-red-soft);
    border: 1px solid rgba(218, 37, 29, 0.18);
    border-radius: 4px;
    padding: 0 3px;
    color: var(--brand-red);
    font-weight: 600;
}

/* ==========================================================================
   Comprehensive Mobile Responsiveness & Mobile Table Card Transformations
   ========================================================================== */

@media (max-width: 768px) {
    /* Layout containment */
    .content-wrapper {
        padding: 1rem 0.875rem 2.5rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .top-header {
        padding: 0.625rem 0.875rem;
        min-height: 56px;
        gap: 0.5rem;
    }

    .header-left {
        gap: 0.5rem;
    }

    .page-title {
        font-size: 0.9375rem;
    }

    .page-subtitle,
    .top-header .page-subtitle {
        display: none !important;
    }

    .header-back-btn {
        padding: 0.35rem 0.5rem;
        min-width: 32px;
        justify-content: center;
    }

    .header-back-btn .back-text {
        display: none !important;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin: 1.5rem 0 0.875rem;
    }

    .section-header > div:last-child {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Status tabs horizontal swipeable bar */
    .status-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.25rem;
        display: flex;
        gap: 0.35rem;
    }

    .status-tab {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
        flex-shrink: 0;
    }

    /* Mobile Table to Stacked Card Conversion */
    .table-container {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow-x: visible !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .table-container table,
    table.table {
        display: block !important;
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .table-container thead,
    table.table thead {
        display: none !important;
    }

    .table-container tbody,
    table.table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.875rem !important;
        width: 100% !important;
    }

    .table-container tbody tr,
    table.table tbody tr {
        display: flex !important;
        flex-direction: column !important;
        background: var(--bg-surface) !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--radius-xl) !important;
        padding: 0.875rem 1rem !important;
        box-shadow: var(--shadow-sm) !important;
        transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .table-container tbody tr:hover,
    table.table tbody tr:hover {
        border-color: var(--border-strong) !important;
        background: var(--bg-surface) !important;
    }

    .table-container td,
    table.table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
        padding: 0.5rem 0 !important;
        border-bottom: 1px dashed var(--border) !important;
        font-size: 0.8125rem !important;
        word-break: break-word !important;
        min-height: 28px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .table-container tbody tr td:last-child,
    table.table tbody tr td:last-child {
        border-bottom: none !important;
        padding-bottom: 0.25rem !important;
    }

    .table-container td::before,
    table.table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.6875rem;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--text-muted);
        text-align: left;
        padding-right: 0.75rem;
        flex-shrink: 0;
    }

    .table-container td:not([data-label])::before,
    table.table td:not([data-label])::before {
        display: none !important;
    }

    .table-container td[colspan],
    table.table td[colspan] {
        display: block !important;
        text-align: center !important;
        padding: 1.5rem 0.75rem !important;
        border-bottom: none !important;
    }

    .table-container td[colspan]::before,
    table.table td[colspan]::before {
        display: none !important;
    }

    /* Action column styling in mobile cards */
    .table-container td[data-label="Actions"]::before,
    .table-container td[data-label="Action"]::before,
    .table-container td[data-label="Admin Action"]::before,
    .table-container td[data-label=""]::before,
    .table-container td.actions::before,
    table.table td[data-label="Actions"]::before,
    table.table td[data-label="Action"]::before,
    table.table td[data-label="Admin Action"]::before,
    table.table td[data-label=""]::before,
    table.table td.actions::before {
        display: none !important;
    }

    .table-container td[data-label="Actions"],
    .table-container td[data-label="Action"],
    .table-container td[data-label="Admin Action"],
    .table-container td.actions,
    table.table td[data-label="Actions"],
    table.table td[data-label="Action"],
    table.table td[data-label="Admin Action"],
    table.table td.actions {
        justify-content: flex-end !important;
        padding-top: 0.75rem !important;
        margin-top: 0.25rem !important;
        border-top: 1px solid var(--border) !important;
        border-bottom: none !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    /* Charts responsive height */
    .chart-card {
        padding: 1rem;
    }

    .chart-container {
        height: 230px !important;
    }

    .chart-container-pie {
        height: 220px !important;
    }

    /* Modals & Dialogs on mobile */
    .modal-backdrop {
        padding: 0.75rem;
    }

    .modal-card,
    .dialog-card {
        padding: 1.25rem;
        max-width: calc(100vw - 1.5rem);
        max-height: 92vh;
        overflow-y: auto;
        box-sizing: border-box;
    }
}

@media (max-width: 640px) {
    .stats-grid,
    .review-grid,
    .field-grid,
    .details-grid,
    .detail-grid,
    .compliance-grid,
    .task-grid,
    .member-grid,
    .member-cards-grid,
    .banner-grid,
    .inflow-stats,
    .expense-stats,
    .payout-grid,
    .payout-overview-grid,
    .balance-cards,
    .info-grid,
    .dashboard-tasks-grid {
        grid-template-columns: 1fr !important;
    }

    .card,
    .stat-card,
    .chart-card,
    .details-card,
    .info-card {
        padding: 1rem 0.875rem !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .search-form {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .dialog-actions {
        flex-direction: column-reverse;
        width: 100%;
    }

    .dialog-actions .btn {
        width: 100%;
    }
}

