/*
|--------------------------------------------------------------------------
| QYVERIX OPERATIONS
|--------------------------------------------------------------------------
| CORE APPLICATION STYLES
|--------------------------------------------------------------------------
*/

:root {

    --primary:
        #4f46e5;

    --primary-dark:
        #4338ca;

    --secondary:
        #0f172a;

    --success:
        #16a34a;

    --warning:
        #f59e0b;

    --danger:
        #dc2626;

    --info:
        #0284c7;

    --light:
        #f8fafc;

    --white:
        #ffffff;

    --border:
        #e2e8f0;

    --text:
        #0f172a;

    --text-light:
        #64748b;

    --sidebar-width:
        280px;

    --topbar-height:
        80px;

    --radius:
        18px;

    --shadow:
        0 10px 35px rgba(15, 23, 42, 0.08);

    --transition:
        all 0.3s ease;
}

/*
|--------------------------------------------------------------------------
| RESET
|--------------------------------------------------------------------------
*/

* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;
}

html {

    scroll-behavior: smooth;
}

body {

    font-family:
        'Inter',
        sans-serif;

    background:
        #f1f5f9;

    color:
        var(--text);

    overflow-x: hidden;
}

/*
|--------------------------------------------------------------------------
| LINKS
|--------------------------------------------------------------------------
*/

a {

    text-decoration: none;

    color: inherit;
}

/*
|--------------------------------------------------------------------------
| BUTTONS
|--------------------------------------------------------------------------
*/

.btn {

    border: none;

    outline: none;

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    gap: 10px;

    padding:
        14px 20px;

    border-radius:
        14px;

    font-size:
        14px;

    font-weight:
        600;

    transition:
        var(--transition);
}

.btn-primary {

    background:
        var(--primary);

    color:
        var(--white);
}

.btn-primary:hover {

    background:
        var(--primary-dark);

    transform:
        translateY(-2px);
}

/*
|--------------------------------------------------------------------------
| APPLICATION LAYOUT
|--------------------------------------------------------------------------
*/

.qyverix-app {

    display:
        flex;

    min-height:
        100vh;
}

/*
|--------------------------------------------------------------------------
| SIDEBAR
|--------------------------------------------------------------------------
*/

.sidebar {

    width:
        var(--sidebar-width);

    background:
        var(--secondary);

    color:
        var(--white);

    position:
        fixed;

    top:
        0;

    left:
        0;

    height:
        100vh;

    display:
        flex;

    flex-direction:
        column;

    z-index:
        999;

    transition:
        var(--transition);
}

.sidebar-header {

    padding:
        24px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    border-bottom:
        1px solid rgba(255,255,255,0.08);
}

.brand {

    display:
        flex;

    align-items:
        center;

    gap:
        14px;
}

.brand-logo {

    width:
        52px;

    height:
        52px;

    object-fit:
        contain;
}

.brand-content h2 {

    font-size:
        20px;

    font-weight:
        800;
}

.brand-content span {

    font-size:
        12px;

    color:
        #94a3b8;
}

.sidebar-close {

    display:
        none;

    background:
        transparent;

    border:
        none;

    color:
        white;

    font-size:
        22px;

    cursor:
        pointer;
}

/*
|--------------------------------------------------------------------------
| NAVIGATION
|--------------------------------------------------------------------------
*/

.sidebar-nav {

    flex:
        1;

    overflow-y:
        auto;

    padding:
        20px 14px;
}

.nav-group {

    margin-bottom:
        28px;
}

.nav-label {

    display:
        block;

    font-size:
        11px;

    text-transform:
        uppercase;

    letter-spacing:
        1px;

    color:
        #94a3b8;

    margin:
        0 14px 14px;
}

.nav-item {

    display:
        flex;

    align-items:
        center;

    gap:
        14px;

    padding:
        14px 16px;

    margin-bottom:
        8px;

    border-radius:
        14px;

    transition:
        var(--transition);

    color:
        #e2e8f0;

    position:
        relative;
}

.nav-item:hover {

    background:
        rgba(255,255,255,0.08);
}

.nav-item.active {

    background:
        var(--primary);

    color:
        white;
}

.nav-item i {

    width:
        18px;

    text-align:
        center;
}

.nav-badge {

    margin-left:
        auto;

    background:
        white;

    color:
        var(--primary);

    min-width:
        22px;

    height:
        22px;

    border-radius:
        50px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        11px;

    font-weight:
        700;
}

/*
|--------------------------------------------------------------------------
| SIDEBAR FOOTER
|--------------------------------------------------------------------------
*/

.sidebar-footer {

    padding:
        20px;

    border-top:
        1px solid rgba(255,255,255,0.08);
}

.user-card {

    display:
        flex;

    align-items:
        center;

    gap:
        14px;
}

.user-avatar img,
.profile-avatar img,
.table-user-avatar img {

    width:
        48px;

    height:
        48px;

    border-radius:
        50%;

    object-fit:
        cover;
}

.user-avatar span,
.profile-avatar span,
.table-user-avatar span {

    width:
        48px;

    height:
        48px;

    border-radius:
        50%;

    background:
        var(--primary);

    color:
        white;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-weight:
        700;
}

.user-info h4 {

    font-size:
        15px;
}

.user-info span {

    font-size:
        12px;

    color:
        #94a3b8;
}

/*
|--------------------------------------------------------------------------
| MAIN CONTENT
|--------------------------------------------------------------------------
*/

.main-content {

    margin-left:
        var(--sidebar-width);

    width:
        calc(100% - var(--sidebar-width));

    min-height:
        100vh;
}

/*
|--------------------------------------------------------------------------
| TOPBAR
|--------------------------------------------------------------------------
*/

.topbar {

    height:
        var(--topbar-height);

    background:
        white;

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    padding:
        0 28px;

    border-bottom:
        1px solid var(--border);

    position:
        sticky;

    top:
        0;

    z-index:
        998;
}

.topbar-left,
.topbar-right {

    display:
        flex;

    align-items:
        center;

    gap:
        18px;
}

.topbar-title h1 {

    font-size:
        24px;

    font-weight:
        700;
}

.topbar-title span {

    color:
        var(--text-light);

    font-size:
        13px;
}

.menu-toggle {

    width:
        46px;

    height:
        46px;

    border-radius:
        14px;

    border:
        none;

    background:
        #eef2ff;

    color:
        var(--primary);

    font-size:
        18px;

    cursor:
        pointer;

    display:
        none;
}

/*
|--------------------------------------------------------------------------
| SEARCH
|--------------------------------------------------------------------------
*/

.topbar-search {

    display:
        flex;

    align-items:
        center;

    gap:
        12px;

    background:
        #f8fafc;

    padding:
        12px 16px;

    border-radius:
        14px;

    min-width:
        280px;
}

.topbar-search input {

    border:
        none;

    outline:
        none;

    background:
        transparent;

    width:
        100%;
}

/*
|--------------------------------------------------------------------------
| CONTENT
|--------------------------------------------------------------------------
*/

.content-wrapper {

    padding:
        28px;
}

.page-header {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        20px;

    margin-bottom:
        28px;
}

.page-header h1 {

    font-size:
        32px;

    font-weight:
        800;

    margin-bottom:
        8px;
}

.page-header p {

    color:
        var(--text-light);
}

/*
|--------------------------------------------------------------------------
| CARDS
|--------------------------------------------------------------------------
*/

.dashboard-card,
.stat-card {

    background:
        white;

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow);
}

.stat-card {

    padding:
        24px;

    display:
        flex;

    align-items:
        center;

    gap:
        18px;
}

.stat-icon {

    width:
        64px;

    height:
        64px;

    border-radius:
        18px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        24px;

    color:
        white;
}

.stat-icon.blue {

    background:
        linear-gradient(135deg,#3b82f6,#2563eb);
}

.stat-icon.green {

    background:
        linear-gradient(135deg,#22c55e,#16a34a);
}

.stat-icon.orange {

    background:
        linear-gradient(135deg,#f59e0b,#d97706);
}

.stat-icon.purple {

    background:
        linear-gradient(135deg,#8b5cf6,#7c3aed);
}

.stat-info h3 {

    font-size:
        28px;

    font-weight:
        800;
}

.stat-info p {

    color:
        var(--text-light);

    margin-top:
        4px;
}

.stats-grid {

    display:
        grid;

    grid-template-columns:
        repeat(auto-fit,minmax(240px,1fr));

    gap:
        24px;

    margin-bottom:
        28px;
}

.dashboard-grid {

    display:
        grid;

    grid-template-columns:
        repeat(auto-fit,minmax(380px,1fr));

    gap:
        24px;

    margin-bottom:
        28px;
}

.dashboard-card {

    padding:
        24px;
}

.card-header {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    margin-bottom:
        22px;
}

.card-header h3 {

    display:
        flex;

    align-items:
        center;

    gap:
        10px;

    font-size:
        18px;
}

/*
|--------------------------------------------------------------------------
| TABLES
|--------------------------------------------------------------------------
*/

.table-responsive {

    overflow-x:
        auto;
}

.data-table {

    width:
        100%;

    border-collapse:
        collapse;
}

.data-table th {

    text-align:
        left;

    padding:
        16px;

    background:
        #f8fafc;

    font-size:
        13px;

    color:
        var(--text-light);
}

.data-table td {

    padding:
        16px;

    border-bottom:
        1px solid #f1f5f9;
}

.table-user {

    display:
        flex;

    align-items:
        center;

    gap:
        12px;
}

.table-user-icon {

    width:
        42px;

    height:
        42px;

    border-radius:
        12px;

    background:
        #eef2ff;

    color:
        var(--primary);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;
}

.table-buttons {

    display:
        flex;

    gap:
        10px;
}

.table-btn {

    width:
        38px;

    height:
        38px;

    border:
        none;

    border-radius:
        12px;

    background:
        #eef2ff;

    color:
        var(--primary);

    cursor:
        pointer;
}

.table-btn.danger {

    background:
        #fef2f2;

    color:
        var(--danger);
}

/*
|--------------------------------------------------------------------------
| BADGES
|--------------------------------------------------------------------------
*/

.status-badge,
.priority-badge,
.type-badge,
.source-badge {

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        8px 14px;

    border-radius:
        50px;

    font-size:
        12px;

    font-weight:
        600;

    background:
        #eef2ff;

    color:
        var(--primary);
}

/*
|--------------------------------------------------------------------------
| FORMS
|--------------------------------------------------------------------------
*/

.form-grid {

    display:
        grid;

    grid-template-columns:
        repeat(auto-fit,minmax(240px,1fr));

    gap:
        20px;
}

.form-group {

    margin-bottom:
        20px;
}

.form-group label {

    display:
        block;

    margin-bottom:
        10px;

    font-size:
        14px;

    font-weight:
        600;
}

.form-group input,
.form-group select,
.form-group textarea {

    width:
        100%;

    padding:
        14px 16px;

    border:
        1px solid var(--border);

    border-radius:
        14px;

    outline:
        none;

    transition:
        var(--transition);

    font-family:
        inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {

    border-color:
        var(--primary);

    box-shadow:
        0 0 0 4px rgba(79,70,229,0.08);
}

/*
|--------------------------------------------------------------------------
| MODAL
|--------------------------------------------------------------------------
*/

.modal {

    position:
        fixed;

    inset:
        0;

    background:
        rgba(15,23,42,0.6);

    display:
        none;

    align-items:
        center;

    justify-content:
        center;

    padding:
        20px;

    z-index:
        9999;
}

.modal.active {

    display:
        flex;
}

.modal-content {

    width:
        100%;

    max-width:
        800px;

    background:
        white;

    border-radius:
        24px;

    padding:
        28px;

    max-height:
        92vh;

    overflow-y:
        auto;
}

.modal-header {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    margin-bottom:
        24px;
}

.modal-close {

    border:
        none;

    background:
        #f1f5f9;

    width:
        42px;

    height:
        42px;

    border-radius:
        12px;

    cursor:
        pointer;
}

/*
|--------------------------------------------------------------------------
| ALERTS
|--------------------------------------------------------------------------
*/

.alert {

    display:
        flex;

    align-items:
        center;

    gap:
        14px;

    padding:
        18px 20px;

    border-radius:
        16px;

    margin-bottom:
        24px;
}

.alert-success {

    background:
        #ecfdf5;

    color:
        #166534;
}

.alert-error {

    background:
        #fef2f2;

    color:
        #991b1b;
}

.alert-warning {

    background:
        #fffbeb;

    color:
        #92400e;
}

.alert-info {

    background:
        #eff6ff;

    color:
        #1d4ed8;
}

/*
|--------------------------------------------------------------------------
| AUTH PAGE
|--------------------------------------------------------------------------
*/

.auth-wrapper {

    min-height:
        100vh;

    display:
        grid;

    grid-template-columns:
        1fr 500px;
}

.auth-left {

    background:
        linear-gradient(
            135deg,
            #0f172a,
            #1e293b
        );

    color:
        white;

    padding:
        60px;

    display:
        flex;

    flex-direction:
        column;

    justify-content:
        center;
}

.auth-right {

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        40px;
}

.auth-card {

    width:
        100%;

    max-width:
        420px;

    background:
        white;

    border-radius:
        28px;

    padding:
        40px;

    box-shadow:
        var(--shadow);
}

/*
|--------------------------------------------------------------------------
| RESPONSIVE
|--------------------------------------------------------------------------
*/

@media (max-width: 1200px) {

    .auth-wrapper {

        grid-template-columns:
            1fr;
    }

    .auth-left {

        display:
            none;
    }
}

@media (max-width: 992px) {

    .sidebar {

        transform:
            translateX(-100%);
    }

    .sidebar.active {

        transform:
            translateX(0);
    }

    .main-content {

        margin-left:
            0;

        width:
            100%;
    }

    .menu-toggle,
    .sidebar-close {

        display:
            flex;

        align-items:
            center;

        justify-content:
            center;
    }

    .mobile-overlay {

        position:
            fixed;

        inset:
            0;

        background:
            rgba(15,23,42,0.4);

        z-index:
            998;

        display:
            none;
    }

    .mobile-overlay.active {

        display:
            block;
    }
}

@media (max-width: 768px) {

    .content-wrapper {

        padding:
            18px;
    }

    .topbar {

        padding:
            0 18px;
    }

    .topbar-search {

        display:
            none;
    }

    .page-header {

        flex-direction:
            column;

        align-items:
            flex-start;
    }

    .dashboard-grid {

        grid-template-columns:
            1fr;
    }

    .form-grid {

        grid-template-columns:
            1fr;
    }
}

/*
|--------------------------------------------------------------------------
| CRUD UI ADDITIONS (forms, buttons, status badges)
|--------------------------------------------------------------------------
*/

.required {
    color: #dc2626;
    font-weight: 700;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #F3EFE7;
    color: #5b5346;
    border: 1px solid #E5DED1;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease;
}

.btn-secondary:hover {
    background: #E9E2D4;
}

.btn-sm  { padding: 6px 12px; font-size: 13px; }
.btn-xs  { padding: 4px 9px;  font-size: 12px; }

/* status badge colour variants */
.status-badge.status-completed,
.status-badge.status-active,
.status-badge.status-converted {
    background: #DCFCE7;
    color: #166534;
}

.status-badge.status-pending,
.status-badge.status-contacted,
.status-badge.status-in-progress {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.status-rejected,
.status-badge.status-failed,
.status-badge.status-inactive,
.status-badge.status-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

/* priority colour variants */
.status-badge.priority-low    { background: #E0F2FE; color: #075985; }
.status-badge.priority-medium { background: #FEF3C7; color: #92400E; }
.status-badge.priority-high   { background: #FEE2E2; color: #991B1B; }

/* modal footer button row */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #E5DED1;
}

.w-full { width: 100%; justify-content: center; }
.badge  { background:#F3EFE7; color:#5b5346; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; }
.badge-info    { background:#E0F2FE; color:#075985; }
.badge-success { background:#DCFCE7; color:#166534; }

/* global search results page */
.search-bar-form { width: 100%; }
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F8F6F1;
    border: 1px solid #E5DED1;
    border-radius: 8px;
    padding: 10px 16px;
}
.search-bar i { color: #9CA3AF; }
.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: #111;
}
.empty-state {
    text-align: center;
    padding: 48px 20px;
}
.empty-state .empty-icon {
    width: 64px; height: 64px;
    margin: 0 auto 18px;
    border-radius: 12px;
    background: #F3EFE7;
    color: #C08A3A;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
}
.empty-state h3 { color: #111; margin-bottom: 6px; }
.empty-state p  { color: #6B7280; font-size: 14px; }

/* payment proof thumbnail */
.proof-thumb {
    display: inline-block;
    width: 46px;
    height: 46px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #E5DED1;
    background: #F8F6F1;
}
.proof-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .15s ease;
}
.proof-thumb:hover img { transform: scale(1.08); }
.dim { color: #9CA3AF; }
.form-hint { display:block; margin-top:6px; color:#9CA3AF; font-size:12px; }
.alert-info { background:#EFF6FF; border:1px solid #BFDBFE; color:#1E40AF; padding:14px 16px; border-radius:8px; margin-bottom:20px; }

/*
|--------------------------------------------------------------------------
| TOPBAR FIXES
|--------------------------------------------------------------------------
| The .topbar-search element is now a <form>, which has a browser-default
| bottom margin that shifts the topbar layout. Reset it. Also make sure
| topbar items don't overflow on smaller screens and the notification /
| profile dropdowns stack above page content.
|--------------------------------------------------------------------------
*/

form.topbar-search { margin: 0; }

/* Make sure dropdown menus float above page content */
.topbar-notifications,
.topbar-profile { position: relative; }

.notification-dropdown,
.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: #fff;
    border: 1px solid #E5DED1;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    z-index: 1000;
    display: none;
    overflow: hidden;
}
.notification-dropdown.active,
.profile-dropdown.active { display: block; }

/* Profile dropdown items: clean rows */
.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #111;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #F3EFE7;
    transition: background .12s ease;
}
.profile-dropdown a:hover { background: #F8F6F1; }
.profile-dropdown a:last-child { border-bottom: none; }
.profile-dropdown hr { margin: 0; border: none; border-top: 1px solid #E5DED1; }
.profile-dropdown a.logout-link { color: #dc2626; }

/* Notification count badge — sit on the bell */
.notification-btn { position: relative; }
.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc2626;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tighter spacing so the topbar fits comfortably on smaller widths */
@media (max-width: 1100px) {
    .topbar-search { min-width: 200px; }
}
@media (max-width: 900px) {
    .topbar-search { display: none; }
}

/*
|--------------------------------------------------------------------------
| TOPBAR — quick-actions, notification bell, profile button
|--------------------------------------------------------------------------
| Without these, the topbar icons stack vertically and look jammed.
|--------------------------------------------------------------------------
*/

.quick-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quick-btn,
.notification-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    background: #F8F6F1;
    border: 1px solid #E5DED1;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
}
.quick-btn:hover,
.notification-btn:hover {
    color: #C08A3A;
    background: #fff;
    border-color: #C08A3A;
}

.profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.profile-btn:hover {
    background: #F8F6F1;
    border-color: #E5DED1;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #C08A3A;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    flex-shrink: 0;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    text-align: left;
}
.profile-meta h4 {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin: 0;
}
.profile-meta span {
    font-size: 11px;
    color: #6B7280;
    margin-top: 2px;
}

.profile-btn > .fa-chevron-down {
    font-size: 11px;
    color: #9CA3AF;
    margin-left: 4px;
}

/* Mobile: collapse the icon row + hide the user's name (avatar stays) */
@media (max-width: 900px) {
    .quick-actions { display: none; }
    .profile-meta  { display: none; }
}

/*
|--------------------------------------------------------------------------
| MOBILE RESPONSIVE — final polish pass
|--------------------------------------------------------------------------
| Foundation already handled: sidebar drawer, mobile overlay, stats-grid
| auto-fit, table-responsive overflow-x, form-grid 1fr. This block fixes
| the remaining gaps: modal overflow, page/topbar headings, card padding,
| dropdown viewport overflow, receipt toolbar, action button wrapping.
|--------------------------------------------------------------------------
*/

@media (max-width: 768px) {

    /* Topbar — auto-height, tighter */
    .topbar              { height: auto; padding: 10px 14px; gap: 10px; }
    .topbar-title h1     { font-size: 17px; }
    .topbar-title span   { font-size: 11px; }
    .topbar-right        { gap: 10px; }

    /* Page header */
    .page-header         { gap: 12px; margin-bottom: 18px; }
    .page-header h1      { font-size: 22px; }
    .page-header p       { font-size: 13px; }
    .page-actions        { flex-wrap: wrap; gap: 8px; width: 100%; }
    .page-actions .btn,
    .page-actions .btn-primary,
    .page-actions .btn-secondary { flex: 1 1 auto; justify-content: center; }

    /* Cards & stats */
    .dashboard-card      { padding: 18px; }
    .stat-card           { padding: 18px; gap: 14px; }
    .stat-icon           { width: 48px; height: 48px; font-size: 18px; }
    .stat-info h3        { font-size: 22px; }
    .stat-info p         { font-size: 12px; }

    /* Modal — scrollable on tall forms */
    .modal               { padding: 12px; align-items: flex-start; }
    .modal-content       { max-height: 92vh; overflow-y: auto; padding: 22px; }
    .modal-header h3     { font-size: 16px; }

    /* Dropdowns shouldn't exceed viewport */
    .notification-dropdown,
    .profile-dropdown {
        right: -6px;
        min-width: 0;
        width: calc(100vw - 32px);
        max-width: 320px;
    }

    /* Tighter table buttons */
    .table-buttons       { gap: 4px; flex-wrap: wrap; }
    .table-btn           { width: 32px; height: 32px; }

    /* View toggle */
    .view-toggle         { padding: 2px; }
    .view-toggle-btn     { padding: 6px 10px; font-size: 12px; }

    /* Sort form inline shrink */
    .table-actions       { flex-wrap: wrap !important; gap: 8px !important; }
    .table-search        { width: 100%; }

    /* Auth login mobile */
    .auth-card           { padding: 28px 22px; }
}

@media (max-width: 480px) {

    .content-wrapper     { padding: 12px; }

    /* Cards even tighter */
    .dashboard-card      { padding: 14px; border-radius: 10px; }
    .stat-card           { padding: 14px; gap: 10px; }
    .stat-icon           { width: 42px; height: 42px; font-size: 16px; border-radius: 12px; }
    .stat-info h3        { font-size: 19px; }

    .stats-grid          { gap: 10px; grid-template-columns: repeat(2, 1fr); }

    .page-header h1      { font-size: 20px; }

    /* Modal nearly full-screen */
    .modal               { padding: 6px; }
    .modal-content       { padding: 18px; border-radius: 8px; }
    .form-group label    { font-size: 13px; }

    /* Receipt toolbar stacks */
    .receipt-wrap .toolbar           { flex-direction: column; gap: 8px; align-items: stretch; }
    .receipt-wrap .toolbar a,
    .receipt-wrap .toolbar button    { width: 100%; justify-content: center; }
}

/* Prevent any single long string (URLs, IDs) from forcing horizontal scroll */
body, .dashboard-card, td, .notification-card {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/*
|--------------------------------------------------------------------------
| KANBAN BOARD (project tasks)
|--------------------------------------------------------------------------
*/

.view-toggle {
    display: inline-flex;
    background: #F8F6F1;
    border: 1px solid #E5DED1;
    border-radius: 8px;
    padding: 3px;
    margin-right: 10px;
}
.view-toggle-btn {
    border: none;
    background: transparent;
    color: #6B7280;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.view-toggle-btn.active {
    background: #fff;
    color: #111;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}
@media (max-width: 1024px) {
    .kanban-board { grid-template-columns: 1fr; }
}

.kanban-column {
    background: #F8F6F1;
    border: 1px solid #E5DED1;
    border-radius: 10px;
    padding: 14px;
    min-height: 280px;
    transition: background .15s ease, border-color .15s ease;
}
.kanban-column.drop-target {
    background: #FEF3C7;
    border-color: #C08A3A;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}
.kanban-column-title { font-weight: 700; color: #111; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.kanban-column-count {
    background: #fff;
    border: 1px solid #E5DED1;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #6B7280;
}

.kanban-column-body { display: flex; flex-direction: column; gap: 10px; min-height: 100px; }

.kanban-card {
    background: #fff;
    border: 1px solid #E5DED1;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    cursor: grab;
    transition: box-shadow .15s ease, transform .15s ease;
}
.kanban-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.kanban-card.dragging { opacity: .5; transform: rotate(-1deg); cursor: grabbing; }

.kanban-card-title { font-weight: 600; color: #111; margin-bottom: 10px; font-size: 14px; line-height: 1.4; }

.kanban-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.kanban-priority {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.kanban-priority.priority-low    { background: #E0F2FE; color: #075985; }
.kanban-priority.priority-medium { background: #FEF3C7; color: #92400E; }
.kanban-priority.priority-high   { background: #FEE2E2; color: #991B1B; }

.kanban-due {
    font-size: 12px;
    color: #6B7280;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.kanban-due.overdue { color: #dc2626; font-weight: 600; }

.kanban-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4B5563;
    padding-top: 8px;
    border-top: 1px solid #F3EFE7;
    margin-bottom: 8px;
}
.kanban-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #C08A3A;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.kanban-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px solid #F3EFE7;
}