/*
 * KMS Lodge - Corporate Design System
 * Premium hotel management ERP styling
 * ISO-compliant, accessible, responsive
 */

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
    /* Brand Colors — Corporate Navy + Gold */
    --primary: #0f1b4c;
    --primary-light: #1a2d6d;
    --primary-dark: #070e2a;
    --primary-rgb: 15, 27, 76;

    --secondary: #c5a55a;
    --secondary-light: #d4b96e;
    --secondary-dark: #a88d3e;
    --secondary-rgb: 197, 165, 90;

    --accent: #2196f3;
    --accent-light: #64b5f6;
    --accent-dark: #1565c0;

    /* Semantic Colors */
    --success: #2e7d32;
    --success-bg: #e8f5e9;
    --danger: #c62828;
    --danger-bg: #ffebee;
    --warning: #ef6c00;
    --warning-bg: #fff3e0;
    --info: #0277bd;
    --info-bg: #e1f5fe;

    /* Neutrals */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* Fonts */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    color: var(--accent-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #1a3a7e 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(197, 165, 90, 0.08) 0%, transparent 70%);
    animation: loginShimmer 15s ease-in-out infinite;
}

@keyframes loginShimmer {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-5%, 5%) rotate(3deg); }
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: white;
    position: relative;
    z-index: 1;
}

.login-left .brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(197, 165, 90, 0.4);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--secondary);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.login-left h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-left .tagline {
    font-size: 16px;
    opacity: 0.7;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.login-features {
    list-style: none;
    max-width: 320px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    opacity: 0.8;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.login-features li i {
    font-size: 18px;
    color: var(--secondary);
    width: 24px;
    text-align: center;
}

.login-right {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-card .subtitle {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-card .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-card .input-group {
    position: relative;
}

.login-card .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
    z-index: 5;
}

.login-card .form-control {
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition-fast);
    background: var(--gray-50);
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 27, 76, 0.08);
    background: white;
    outline: none;
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.login-card .btn-login:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.login-card .btn-login:active {
    transform: translateY(0);
}

.login-card .btn-login .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

.login-card .btn-login.loading .btn-text { display: none; }
.login-card .btn-login.loading .spinner { display: block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 12px;
}

.login-footer .iso-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--gray-600);
    margin-top: 8px;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--header-height);
}

.sidebar-brand .brand-logo {
    width: 38px;
    height: 38px;
    background: rgba(197, 165, 90, 0.15);
    border: 1.5px solid rgba(197, 165, 90, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--secondary);
    flex-shrink: 0;
}

.sidebar-brand .brand-info h4 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand .brand-info span {
    font-size: 11px;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 4px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    padding: 12px 12px 6px;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-fast);
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.nav-link.active {
    background: rgba(197, 165, 90, 0.15);
    color: var(--secondary);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--secondary);
    border-radius: 0 3px 3px 0;
}

.nav-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* Sidebar User */
.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    background: rgba(197, 165, 90, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary);
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-info h6 {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-info small {
    font-size: 11px;
    opacity: 0.5;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition-fast);
    display: none; /* Show on mobile */
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.page-title-inline {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    background: none;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.header-btn .notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
}

.header-user:hover {
    background: var(--gray-100);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.header-user-info {
    text-align: right;
}
.header-user-info .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}
.header-user-info .role {
    font-size: 11px;
    color: var(--gray-500);
}

/* Page Content Area */
.page-content {
    padding: 24px;
    padding-bottom: 80px; /* Room for fixed footer */
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i {
    color: var(--primary);
    font-size: 24px;
}

.breadcrumb-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
}

.breadcrumb-custom a {
    color: var(--gray-500);
}
.breadcrumb-custom a:hover { color: var(--primary); }
.breadcrumb-custom .separator { color: var(--gray-300); }
.breadcrumb-custom .current { color: var(--gray-700); font-weight: 600; }

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-card .stat-change {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.stat-card .stat-change.up {
    background: var(--success-bg);
    color: var(--success);
}

.stat-card .stat-change.down {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-icon.blue { background: #e3f2fd; color: #1565c0; }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.purple { background: #f3e5f5; color: #6a1b9a; }
.stat-icon.primary { background: rgba(15,27,76,0.08); color: var(--primary); }

/* ============================================================
   CARD COMPONENT
   ============================================================ */
.card-custom {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-custom .card-header-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-custom .card-header-custom h5 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-custom .card-header-custom h5 i {
    color: var(--primary);
}

.card-custom .card-body-custom {
    padding: 20px;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}

.table-custom thead th {
    background: var(--gray-50);
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    text-align: left;
    white-space: nowrap;
}

.table-custom tbody td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background: rgba(15, 27, 76, 0.02);
}

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

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table-custom {
        min-width: 600px; /* Force scroll on small screens for basic tables */
    }
    
    /* Grid-style Room Cards for Staff */
    .table-mobile-cards { display: block; border: none; }
    .table-mobile-cards thead { display: none; }
    .table-mobile-cards tbody { 
        display: grid; 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
        gap: 12px; 
        padding: 10px;
    }
    .table-mobile-cards tbody tr { 
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 20px 10px; 
        background: white;
        border: 1px solid var(--gray-200);
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow-sm);
        text-align: center;
        min-height: 120px;
        transition: transform 0.2s;
    }
    .table-mobile-cards tbody tr:active { transform: scale(0.98); }
    
    .table-mobile-cards tbody td { 
        display: none; /* Hide everything by default on card */
        padding: 0;
        border: none;
        width: 100%;
        justify-content: center;
    }
    
    /* Show only Room and Status on the small card */
    .table-mobile-cards td[data-label="Room"],
    .table-mobile-cards td[data-label="Status"] {
        display: flex !important;
    }
    
    .table-mobile-cards .mobile-card-header {
        background: transparent !important;
        color: var(--primary) !important;
        margin: 0 0 8px 0 !important;
        padding: 0 !important;
        font-size: 20px !important;
        font-weight: 800 !important;
    }
    .table-mobile-cards .mobile-card-header::before { display: none; }
    .table-mobile-cards .mobile-card-header * { font-size: 20px !important; color: var(--primary) !important; }
    
    .table-mobile-cards td[data-label="Status"] .status-badge {
        font-size: 10px;
        padding: 4px 8px;
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 0.5px;
    }
    .table-mobile-cards .show-on-mobile { display: none !important; } /* Clean look */
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary-custom {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary-custom:hover {
    background: var(--primary-light);
    color: white;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn-secondary-custom {
    background: white;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
    padding: 8px 18px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-secondary-custom:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-success-custom {
    background: var(--success);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-success-custom:hover {
    background: #1b5e20;
    color: white;
}

.btn-danger-custom {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}
.show-on-mobile { display: none; }

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-available { background: var(--success-bg); color: var(--success); }
.status-occupied { background: var(--danger-bg); color: var(--danger); }
.status-dirty { background: var(--warning-bg); color: var(--warning); }
.status-maintenance { background: #f3e5f5; color: #6a1b9a; }
.status-blocked { background: var(--gray-200); color: var(--gray-600); }
.status-confirmed { background: #e3f2fd; color: #1565c0; }
.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-cancelled { background: var(--danger-bg); color: var(--danger); }
.status-active { background: var(--success-bg); color: var(--success); }
.status-inactive { background: var(--gray-200); color: var(--gray-600); }

/* ============================================================
   FORM STYLING
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
}

.form-control-custom {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
    background: white;
    color: var(--gray-800);
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 27, 76, 0.08);
    outline: none;
}

.form-control-custom::placeholder {
    color: var(--gray-400);
}

select.form-control-custom {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23616161' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea.form-control-custom {
    resize: vertical;
    min-height: 80px;
}

/* ============================================================
   ALERT / FLASH MESSAGES
   ============================================================ */
.alert-custom {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    animation: alertSlide 0.3s ease-out;
}

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

.alert-custom i {
    font-size: 18px;
    margin-top: 1px;
}

.alert-success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); border-left: 44px solid var(--info); }

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.5;
    color: inherit;
}

.alert-close:hover { opacity: 1; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    margin-bottom: 20px;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================================
   ISO & COMPLIANCE FOOTER
   ============================================================ */
.admin-footer {
    padding: 12px 24px;
    text-align: center;
    color: var(--gray-500);
    font-size: 11px;
    border-top: 1px solid var(--gray-200);
    background: white;
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
    transition: var(--transition);
}

.admin-footer .compliance-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
}

.admin-footer .compliance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--gray-500);
    background: var(--gray-50);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .admin-footer {
        left: 0;
    }
    .top-header {
        padding: 0 12px;
    }
    #headerClock, #fullscreenBtn {
        display: none !important;
    }
    .page-title-inline {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    .sidebar-toggle {
        display: block;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
        display: none;
    }
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }
    .login-left {
        padding: 40px 24px 30px;
    }
    .login-left h1 { font-size: 24px; }
    .login-features { display: none; }
    .login-right {
        width: 100%;
        padding: 24px;
    }
    .page-content { padding: 16px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .stat-card .stat-value { font-size: 22px; }
    
    /* Room Grid Enhancements */
    .room-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
        gap: 8px !important;
    }
    .room-card {
        padding: 10px !important;
    }
    .room-card .room-num {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .header-user-info { display: none; }
    .header-user { padding: 4px; }
    .header-user-avatar { width: 30px; height: 30px; }
    .page-title-inline { max-width: 100px; font-size: 13px; }
    .login-left { padding: 30px 20px 20px; }
    .login-right { padding: 20px; }
    .sidebar-brand .brand-info h4 { font-size: 14px; }
    .hide-on-mobile { display: none !important; }
    .show-on-mobile { display: block !important; }
    .table-mobile-cards tbody td { 
        padding-top: 20px;
        padding-bottom: 20px;
        justify-content: flex-start;
    }
    .page-header h1 { font-size: 18px; }
    .accounts-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .acc-card { padding: 16px !important; }
    .acc-card .acc-icon { width: 40px; height: 40px; font-size: 18px; }
    .acc-card .acc-title { font-size: 12px; }
    .acc-card .acc-value { font-size: 18px; }
}

/* ============================================================
   ACCOUNTS MODULE - Card Grid
   ============================================================ */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.acc-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.acc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.acc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--primary-rgb), 0.15);
    color: inherit;
    text-decoration: none;
}

.acc-card:hover::before {
    opacity: 1;
}

.acc-card .acc-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.acc-card:hover .acc-icon {
    transform: scale(1.1);
}

.acc-card .acc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.acc-card .acc-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
}

.acc-card .acc-subtitle {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* Accounts Icon Colors */
.acc-icon.receipts { background: #e8f5e9; color: #2e7d32; }
.acc-icon.payments { background: #ffebee; color: #c62828; }
.acc-icon.bank { background: #e3f2fd; color: #1565c0; }
.acc-icon.cash { background: #fff3e0; color: #ef6c00; }
.acc-icon.purchases { background: #fce4ec; color: #ad1457; }
.acc-icon.suppliers { background: #e0f2f1; color: #00695c; }
.acc-icon.sales { background: #e8eaf6; color: #283593; }
.acc-icon.customers { background: #f3e5f5; color: #6a1b9a; }
.acc-icon.expenses { background: #fbe9e7; color: #bf360c; }
.acc-icon.incomes { background: #e0f7fa; color: #00838f; }
.acc-icon.salaries { background: #efebe9; color: #4e342e; }
.acc-icon.balance { background: rgba(15,27,76,0.08); color: var(--primary); }
.acc-icon.inventory { background: #e8eaf6; color: #1a237e; }

/* Accounts sub-page styles */
.acc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.acc-form-grid .form-group {
    display: flex;
    flex-direction: column;
}
.acc-form-grid .form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.acc-form-grid .form-group input,
.acc-form-grid .form-group select,
.acc-form-grid .form-group textarea {
    padding: 10px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
    background: var(--gray-50);
}
.acc-form-grid .form-group input:focus,
.acc-form-grid .form-group select:focus,
.acc-form-grid .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08);
    background: white;
    outline: none;
}
.acc-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

/* Tablet */
@media (max-width: 1024px) {
    .accounts-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* Account Masters Portal */
.acc-masters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 10px;
}
.master-category {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
}
.master-category:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}
.master-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}
.master-header i {
    font-size: 24px;
}
.master-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 16px;
}
.master-header span {
    font-size: 11px;
    opacity: 0.9;
    display: block;
}
.master-header.debtors { background: linear-gradient(135deg, #3498db, #2980b9); }
.master-header.creditors { background: linear-gradient(135deg, #e67e22, #d35400); }
.master-header.banks { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.master-header.expenses { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.master-header.incomes { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.master-content {
    padding: 20px;
}
.master-content p {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 20px;
    line-height: 1.5;
}
.master-actions {
    display: flex;
    gap: 10px;
}

/* ============================================================
   PHONE INPUT STANDARDIZATION
   ============================================================ */
.phone-input-group {
    display: flex;
    align-items: stretch;
}
.phone-prefix {
    background: var(--gray-100);
    border: 1.5px solid var(--gray-300);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    padding: 0 12px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 700;
    white-space: nowrap;
}
.phone-input-group .form-control-custom,
.phone-input-group .form-control {
    border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
    flex: 1;
    margin-bottom: 0 !important;
}

/* GMail Only Badge */
.gmail-only-badge {
    font-size: 10px;
    background: #ff5252;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
    display: inline-block;
}

/* ============================================================
   GLOBAL MODAL SYSTEM
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content-custom {
    background: white;
    width: 100%;
    max-width: 450px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-header-custom {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.modal-header-custom h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.modal-body-custom {
    padding: 24px;
}

.modal-footer-custom {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    text-align: right;
    background: var(--gray-50);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
/* ============================================================
   BUTTON LOADING STATES
   ============================================================ */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.btn-loading {
    pointer-events: none !important;
    opacity: 0.8 !important;
    cursor: wait !important;
}

.btn-loading .btn-text,
.btn-loading > span:not(.btn-spinner),
.btn-loading > i {
    display: none !important;
}

.btn-loading .btn-spinner {
    display: inline-block !important;
}
