/* ==========================================================================
   1. BASE STYLES & RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

:root {
    /* Color Palette */
    --primary-color: #1e3c72;
    --primary-dark: #122546;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-light: #f4f6f9;
    --text-main: #333333;
    --text-muted: #777777;
    --sidebar-text: #94a3b8; /* Premium Slate Gray text link color */
    --success: #198754;      /* Adjusted to hex format from image_283f87.png */
    --danger: #dc3545;       /* Adjusted to hex format from image_283f87.png */
    --warning: #ffc107;      /* Adjusted to hex format from image_283f87.png */
    --info: #0d6efd;         /* Adjusted to hex format from image_283f87.png */
    --border-color: #e1e8ed;

    /* Layout Dimensions */
    --header-height: 60px;
    --footer-height: 40px;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
}

/* ==========================================================================
   2. AUTHENTICATION PAGES (Login / Logout)
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 0% 0%, #1a365d 0%, #0f172a 100%);
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.auth-card h2 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--secondary-color);
}

.input-group-custom {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group-custom i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    transition: color 0.3s;
    font-size: 16px;
}

.form-control {
    width: 100%;
    padding: 12px 15px 12px 45px; /* Added left padding layout for clean icon alignments */
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    border-radius: 6px;
    height: 48px;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.form-control:focus + i {
    color: var(--accent-color);
}

.btn-primary {
    width: 100%;
    height: 48px;
    padding: 12px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.2);
    border: none;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(30, 60, 114, 0.3);
}

.error-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--danger);
    background-color: #fde8e8;
    border: 1px solid #f8b4b4;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
    font-weight: 500;
}

/* ==========================================================================
   3. ERP SYSTEM LAYOUT (Fixed Structure)
   ========================================================================== */

/* Fixed Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    z-index: 1030;
}

.brand-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.5px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.user-profile i {
    color: var(--primary-color);
}

/* Fixed Sidebar Layout - Premium Dark & Strict 12px Font Sizing */
.sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: var(--footer-height);
    left: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%); /* Slate Dark Theme */
    padding-top: 10px;
    z-index: 1020;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: width 0.3s ease;
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 12px !important; /* Strictly enforced 12px Font Size */
    font-weight: 500;
    letter-spacing: 0.3px;
    border-left: 3px solid transparent;
}

.sidebar a i {
    margin-right: 12px;
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
}

.sidebar a:hover i {
    color: #38bdf8; /* Sky blue tint on menu hover entries */
}

.sidebar a.active {
    background: rgba(56, 189, 248, 0.1); /* Sky blue active soft indicator style tint */
    color: #38bdf8;
    font-weight: 600;
    border-left: 3px solid #38bdf8;
}

.sidebar a.active i {
    color: #38bdf8;
}

.sidebar .sidebar-heading {
    font-size: 10px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    padding: 18px 20px 6px 20px;
}

/* Main Content Workspace Wrapper */
.main-wrapper {
    margin-top: var(--header-height);
    margin-bottom: var(--footer-height);
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    transition: margin-left 0.3s ease;
}

.main-wrapper h2 {
    color: var(--secondary-color);
    margin-bottom: 5px;
}

/* Fixed Bottom Footer */
.bottom-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    z-index: 1030;
}

/* ==========================================================================
   4. COMMON ERP INTERFACE COMPONENTS (Updated as per image_283f87.png)
   ========================================================================== */

/* Header Identity Box Layout Components */
.dashboard-title-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}

.logged-identity-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 15px;
}

/* Metrics Cards Grid Layout Structure */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 25px;
    margin-bottom: 25px;
}

.card {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Thick Left-Border Layout Rules for Metric Cards */
.card-gross-income { border-left: 4px solid var(--success) !important; }
.card-gross-expenses { border-left: 4px solid var(--danger) !important; }
.card-booking-agents { border-left: 4px solid var(--warning) !important; }
.card-net-profit { border-left: 4px solid var(--info) !important; }

.metric-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    margin-top: 5px;
}

/* System Security Identity Lock Alert Banner Layout */
.system-lock-banner {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 10px;
    color: #92400e;
}

/* Data Tables */
.table-container {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-top: 20px;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.erp-table th {
    background-color: #f8f9fa;
    color: var(--secondary-color);
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 2px solid var(--border-color);
}

.erp-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: #555;
}

.erp-table tr:hover {
    background-color: #fdfdfd;
}

/* Status Badges */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-success { background: #e8f8f0; color: var(--success); }
.badge-danger { background: #fde8e8; color: var(--danger); }
.badge-warning { background: #fef5e7; color: #f39c12; }

/* ==========================================================================
   5. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar a span,
    .sidebar .sidebar-heading {
        display: none; /* Collapses menu strings down cleanly on narrow screen profiles */
    }
    
    .sidebar a i {
        margin-right: 0;
        font-size: 18px;
        width: 100%;
    }
    
    .main-wrapper {
        margin-left: var(--sidebar-collapsed-width);
        padding: 20px 15px;
    }
}