/* =========================================================
   SANGGAR TARI MANAGEMENT SYSTEM - MASTER DESIGN SYSTEM
   ========================================================= */

:root {
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;

    /* Color Palette */
    --bg-main: #0b0f19;
    --bg-card: #151c2c;
    --bg-card-hover: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-header: rgba(15, 23, 42, 0.85);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(147, 51, 234, 0.3);

    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-light: rgba(139, 92, 246, 0.15);
    
    --secondary: #d97706;
    --secondary-hover: #b45309;

    --accent-gold: #f59e0b;
    --accent-teal: #14b8a6;
    --accent-pink: #ec4899;

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

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

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

/* Sidebar */
.app-sidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

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

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.sidebar-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.sidebar-title span {
    font-size: 0.72rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link:hover i {
    color: var(--primary);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, var(--primary-light), rgba(139, 92, 246, 0.05));
    border-left: 3.5px solid var(--primary);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--primary);
}

/* Sidebar Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    justify-content: space-between;
}

.dropdown-toggle .chevron {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.nav-dropdown.open .chevron {
    transform: rotate(180deg);
}

.dropdown-menu-list {
    display: none;
    padding-left: 2rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.nav-dropdown.open .dropdown-menu-list {
    display: block;
}

.dropdown-sublink {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.dropdown-sublink:hover, .dropdown-sublink.active {
    color: var(--accent-gold);
}

/* Sidebar User Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-teal), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

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

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Main Content Area */
.app-main {
    margin-left: 270px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Header Bar */
.app-header {
    height: 70px;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    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: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
}

.page-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Role Switcher Pill */
.role-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

.role-badge-pill.role-admin {
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.1);
}

.role-badge-pill.role-sanggar {
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

/* Sanggar Selector Dropdown for Admin */
.sanggar-selector-form select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
}

.sanggar-selector-form select:hover {
    border-color: var(--primary);
}

/* Quick Role Switch Buttons */
.btn-switch-role {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.btn-switch-role:hover {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Content Body */
.app-content {
    padding: 2rem;
    flex: 1;
}

/* Alert Notifications */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-success {
    background-color: var(--success-bg);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}
.alert-danger {
    background-color: var(--danger-bg);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.alert-info {
    background-color: var(--info-bg);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

/* Metric Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
}

.metric-info .label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.metric-info .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.metric-info .sub-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.metric-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
}

.metric-icon.gold {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
}

.metric-icon.teal {
    background: rgba(20, 184, 166, 0.15);
    color: var(--accent-teal);
}

.metric-icon.pink {
    background: rgba(236, 72, 153, 0.15);
    color: var(--accent-pink);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 1.5rem;
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

.custom-table th {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

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

.custom-table tbody tr {
    transition: background-color 0.2s ease;
}

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

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success {
    background-color: var(--success-bg);
    color: #34d399;
}
.badge-warning {
    background-color: var(--warning-bg);
    color: #fbbf24;
}
.badge-danger {
    background-color: var(--danger-bg);
    color: #f87171;
}
.badge-info {
    background-color: var(--info-bg);
    color: #60a5fa;
}

/* Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45);
}

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

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

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

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

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    color: #fff;
    font-family: var(--font-primary);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 700;
}

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

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
}

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

/* Login Screen Styling */
.login-body {
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a, #0b0f19);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-wrapper {
    display: flex;
    width: 100%;
    max-width: 1050px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.login-banner {
    flex: 1.2;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.9), rgba(15, 23, 42, 0.95)), url('https://images.unsplash.com/photo-1547153760-18fc86324498?auto=format&fit=crop&w=1200&q=80') center/cover;
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.banner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    align-self: flex-start;
}

.banner-content h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1.25;
    color: #fff;
    margin-bottom: 1rem;
}

.banner-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.demo-role-cards {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.card-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.demo-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-demo {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-demo:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.btn-demo i {
    font-size: 1.3rem;
}

.btn-demo.admin i {
    color: var(--accent-gold);
}
.btn-demo.sanggar i {
    color: var(--accent-teal);
}

.btn-demo div strong {
    display: block;
    font-size: 0.88rem;
}
.btn-demo div small {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
}

.login-card-container {
    flex: 1;
    padding: 3.5rem;
    display: flex;
    align-items: center;
}

.login-card {
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.login-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.3rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Kuitansi & Print Styles */
@media print {
    body {
        background-color: #fff !important;
        color: #000 !important;
    }
    .app-sidebar, .app-header, .btn, .alert, .modal-close {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .custom-table th, .custom-table td {
        color: #000 !important;
        border-bottom: 1px solid #ccc !important;
    }
}

/* =========================================================
   RESPONSIVE DESIGN SYSTEM (MOBILE & TABLET ADAPTATION)
   ========================================================= */

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Tablet & Mobile Screens (max-width: 992px) */
@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
        width: 280px;
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

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

    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .app-header {
        padding: 1rem 1.25rem;
    }

    .app-content {
        padding: 1.25rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* Smartphone Screens (max-width: 768px) */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sanggar-selector-form {
        width: 100%;
    }

    .sanggar-selector-form select {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-info .value {
        font-size: 1.35rem;
    }

    .metric-info .label {
        font-size: 0.78rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0.5rem;
    }

    .custom-table th, .custom-table td {
        padding: 0.75rem 0.6rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .form-group {
        width: 100% !important;
    }

    .btn {
        width: auto;
    }

    /* Mobile Login Screen Optimization */
    .login-body {
        padding: 1.25rem 0.85rem !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 100vh !important;
    }

    .login-wrapper {
        flex-direction: column !important;
        max-width: 410px !important;
        width: 100% !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
        border: 1px solid var(--border-color) !important;
    }

    /* Hide heavy decorative banner on mobile so login fields fit on screen without scrolling */
    .login-banner {
        display: none !important;
    }

    .login-card-container {
        padding: 1.75rem 1.25rem !important;
        width: 100% !important;
    }

    .logo-circle {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
        margin-bottom: 0.6rem !important;
    }

    .login-header {
        margin-bottom: 1.15rem !important;
    }

    .login-header h2 {
        font-size: 1.35rem !important;
    }

    .login-header p {
        font-size: 0.8rem !important;
    }

    .login-form .form-group {
        margin-bottom: 0.9rem !important;
    }

    .login-form label {
        font-size: 0.8rem !important;
        margin-bottom: 0.3rem !important;
    }

    .login-form .form-control {
        padding: 0.65rem 0.85rem !important;
        font-size: 0.88rem !important;
    }

    .login-form button {
        padding: 0.7rem !important;
        font-size: 0.9rem !important;
        margin-top: 0.25rem !important;
    }

    .login-footer {
        margin-top: 1.25rem !important;
        font-size: 0.72rem !important;
    }
}

/* Small Smartphone Screens (max-width: 480px) */
@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .page-title h2 {
        font-size: 1.2rem;
    }

    .role-badge-pill {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }

    .login-wrapper {
        max-width: 100% !important;
    }

    .login-card-container {
        padding: 1.5rem 1rem !important;
    }

    .login-header h2 {
        font-size: 1.25rem !important;
    }
}
