/* Custom Premium CSS for Hisab-Kitab ERP */

/* Typography & Variables — Fonts loaded via <link> tag in app.blade.php */

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-sidebar: #131b2e;
    --bg-card: rgba(22, 30, 49, 0.85);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(99, 102, 241, 0.25);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --color-primary: #6366f1; /* Indigo */
    --color-primary-hover: #4f46e5;
    --color-success: #10b981; /* Emerald */
    --color-danger: #ef4444; /* Rose */
    --color-warning: #f59e0b; /* Amber */
    --color-info: #06b6d4; /* Cyan */
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px 0 rgba(99, 102, 241, 0.15);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Left Sidebar */
.sidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transition: transform var(--transition-normal);
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-info));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.sidebar-brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.sidebar-item a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    transition: transform var(--transition-normal);
}

.sidebar-item a:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-item a:hover i {
    transform: scale(1.15);
}

.sidebar-item.active a {
    color: white;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    border-left: 3px solid var(--color-primary);
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.05);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: 270px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    height: 75px;
    background-color: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.5rem;
    color: white;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Content Container */
.content-wrapper {
    padding: 2rem;
    flex: 1;
}

/* Card Components */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 60%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.income {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.stat-icon.expense {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.stat-icon.profit {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
}

.stat-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

/* Common Card Layouts */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Custom Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
    font-family: var(--font-body);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background-color: var(--color-success);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 8px;
    line-height: 1;
}

/* Premium Tables */
.table-container {
    overflow-x: auto;
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background-color: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: background-color var(--transition-fast);
}

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-income {
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-expense {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-cash {
    background-color: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-bank {
    background-color: rgba(6, 182, 212, 0.12);
    color: var(--color-info);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    background-color: rgba(11, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    color: white;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
    background-color: rgba(11, 15, 25, 0.9);
}

select.form-control option {
    background-color: var(--bg-secondary);
    color: white;
}

/* Months Checkbox Grid for Rent Collection */
.months-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    background-color: rgba(11, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 10px;
}

@media (max-width: 480px) {
    .months-checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 360px) {
    .months-checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 550px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.close-modal:hover {
    color: white;
}

/* Grid Layouts for Content */
.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
    align-items: start;
}

/* Filter Form Layout (Transactions page) */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 320px;
}

/* Flash Messages */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-toast {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--color-primary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    color: white;
    font-size: 0.9rem;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.alert-toast.success {
    border-left-color: var(--color-success);
}

.alert-toast.error {
    border-left-color: var(--color-danger);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Sidebar Toggle & Close Buttons */
.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: color var(--transition-fast), background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

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

/* Sidebar backdrop overlay for mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

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

/* Modals Body Scrollability */
.modal-body {
    max-height: 65vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile action buttons wrapper utility */
.mobile-action-wrap {
    display: inline-flex;
    gap: 0.4rem;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

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

/* Tablets & smaller desktops */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Tablets in portrait & large phones */
@media (max-width: 768px) {
    /* --- Sidebar Drawer --- */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
        width: 270px;
        z-index: 60;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-backdrop {
        display: block;
    }
    
    .sidebar-toggle-btn {
        display: inline-flex;
    }
    
    .close-sidebar-btn {
        display: block;
    }
    
    /* --- Main Content --- */
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* --- Top Navbar --- */
    .top-navbar {
        height: auto;
        min-height: 60px;
        padding: 0.65rem 0.75rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .page-title {
        font-size: 1.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 65vw;
    }
    
    .navbar-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 0.5rem;
        margin-top: 0.25rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }
    
    .navbar-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.25rem;
    }
    
    .navbar-date {
        display: none !important;
    }
    
    /* --- Content Wrapper --- */
    .content-wrapper {
        padding: 0.75rem;
    }
    
    /* --- Stat Cards --- */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 1rem 0.75rem;
        border-radius: 12px;
    }
    
    .stat-card:hover {
        transform: none; /* disable hover lift on touch */
    }
    
    .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.3px;
    }
    
    .stat-value {
        font-size: 1.15rem;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
    /* --- Content Cards --- */
    .content-card {
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    /* --- Chart --- */
    .chart-container {
        height: 220px;
    }
    
    /* --- Tables: horizontal scroll with minimum column widths --- */
    .table-container {
        border-radius: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .custom-table {
        min-width: 600px;
    }
    
    .custom-table th,
    .custom-table td {
        padding: 0.7rem 0.6rem;
        font-size: 0.78rem;
        white-space: nowrap;
    }
    
    /* --- Buttons --- */
    .btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.78rem;
        min-height: 36px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.72rem;
    }
    
    .btn-icon {
        padding: 0.4rem 0.5rem;
    }
    
    /* --- Forms --- */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 0.85rem;
    }
    
    .form-control {
        padding: 0.65rem 0.85rem;
        font-size: 16px; /* prevents iOS zoom on focus */
        border-radius: 8px;
    }
    
    /* --- Modals --- */
    .modal-overlay {
        align-items: flex-end; /* slide up from bottom on mobile */
        padding: 0;
    }
    
    .modal-content {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
        margin: 0;
    }
    
    .modal-overlay.active .modal-content {
        transform: translateY(0);
    }
    
    .modal-header {
        padding: 1.15rem 1rem;
        position: sticky;
        top: 0;
        background-color: var(--bg-secondary);
        z-index: 2;
    }
    
    .modal-header .card-title {
        font-size: 0.95rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: 60vh;
    }
    
    .modal-footer {
        padding: 0.85rem 1rem;
        position: sticky;
        bottom: 0;
        background-color: var(--bg-secondary);
        z-index: 2;
    }
    
    /* --- Toast Notifications --- */
    .alert-container {
        top: 10px;
        right: 10px;
        left: 10px;
        align-items: stretch;
    }
    
    .alert-toast {
        min-width: unset;
        width: 100%;
        font-size: 0.82rem;
        padding: 0.75rem 1rem;
    }
    
    /* --- Filter toolbar (Transactions page) --- */
    .filter-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-group {
        min-width: unset;
        flex: unset;
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
}

/* Small phones (under 480px) */
@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.85rem 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.68rem;
    }
    
    .page-title {
        font-size: 1.05rem;
        max-width: 55vw;
    }
    
    /* Stack action buttons vertically in table rows */
    .mobile-action-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }
    
    .mobile-action-wrap .btn {
        justify-content: center;
        width: 100%;
        font-size: 0.72rem;
    }
    
    .modal-body {
        max-height: 55vh;
    }
    
    .sidebar-brand {
        padding: 1.25rem 1rem;
    }
    
    .sidebar-menu {
        padding: 1rem 0.75rem;
    }
    
    .sidebar-item a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Very small phones (under 360px) */
@media (max-width: 360px) {
    .content-wrapper {
        padding: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
    
    .top-navbar {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 0.95rem;
    }
}
