/* C:\xampp\htdocs\YSRGOLDENTRAVELS\assets\css\style.css */

:root {
    --gold-primary: #d97706;
    --gold-hover: #b45309;
    --gold-light: #fffbeb;
    --gold-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    
    --bg-main: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.brand-header {
    padding: 18px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-title {
    font-size: 13.5px;
    font-weight: bold;
    color: var(--gold-primary);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.brand-tagline {
    font-size: 10.5px;
    color: #94a3b8;
    white-space: nowrap;
}

.nav-menu {
    list-style: none;
    padding: 15px 10px;
    flex-grow: 1;
    overflow-y: auto;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background-color: rgba(217, 119, 6, 0.15);
    border-left: 3px solid var(--gold-primary);
}

.nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--gold-primary);
}

/* SUBMENU DROPDOWN STYLES (SINGLE LINE FIT) */
.nav-submenu {
    list-style: none;
    padding-left: 20px;
    margin-top: 2px;
    display: none;
}

.nav-item.has-submenu.open .nav-submenu {
    display: block;
}

.nav-item.has-submenu .submenu-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.2s ease;
}

.nav-item.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.nav-submenu-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 12.5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-submenu-link:hover, .nav-submenu-link.active {
    color: #ffffff;
    background: rgba(217, 119, 6, 0.2);
    font-weight: bold;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Bar */
.header-bar {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 15px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    z-index: 95;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-main);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    width: 330px;
    position: relative;
    transition: all 0.25s ease;
}

.search-box:focus-within {
    width: 440px;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
    background: #ffffff;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 13px;
}

.global-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 560px;
    min-width: 460px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    max-height: 460px;
    overflow: hidden;
    z-index: 9999;
    padding: 0;
    box-sizing: border-box;
}

.global-search-header {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.global-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border-bottom: 1px solid #f8fafc;
}

.global-search-item:hover, .global-search-item.selected {
    background: #f8fafc;
    transform: translateX(2px);
}

.global-search-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    flex-shrink: 0;
}

.global-search-details {
    flex: 1;
    min-width: 0;
}

.global-search-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-subtitle {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold-light);
}

.user-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.user-info p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Page Container */
.page-container {
    padding: 30px;
    flex-grow: 1;
}

/* Dashboard Banner */
.welcome-banner {
    background: var(--gold-gradient);
    color: white;
    padding: 25px 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.welcome-banner h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.welcome-banner p {
    font-size: 13px;
    opacity: 0.9;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kpi-title {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.kpi-icon.sale { background: #ecfdf5; color: #10b981; }
.kpi-icon.expense { background: #fef2f2; color: #ef4444; }
.kpi-icon.profit { background: #fffbeb; color: #d97706; }
.kpi-icon.due { background: #f0f9ff; color: #0284c7; }
.kpi-icon.cash { background: #f0fdf4; color: #16a34a; }
.kpi-icon.bank { background: #eff6ff; color: #2563eb; }

.kpi-amount {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-primary);
}

.kpi-subtext {
    font-size: 11px;
    color: var(--success);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Quick Actions Bar */
.quick-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.quick-actions-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--text-primary);
    margin-right: 10px;
}

.btn-action {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-action:hover {
    background: var(--gold-primary);
    color: #ffffff;
    border-color: var(--gold-primary);
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
}

.btn-action-primary {
    background: var(--gold-primary) !important;
    color: #ffffff !important;
    border-color: var(--gold-primary) !important;
    font-weight: 600 !important;
}

.btn-action-primary:hover {
    background: var(--gold-hover) !important;
    border-color: var(--gold-hover) !important;
    color: #ffffff !important;
}

.btn-action-dark {
    background: #1e293b !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
    font-weight: 600 !important;
}

.btn-action-dark:hover {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}

.btn-action-reset {
    background: #475569 !important;
    color: #ffffff !important;
    border-color: #334155 !important;
    font-weight: 600 !important;
}

.btn-action-reset:hover {
    background: #64748b !important;
    color: #ffffff !important;
}

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

.card-box {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-box-title {
    font-size: 15px;
    font-weight: bold;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

.custom-table th {
    background-color: #f1f5f9;
    color: var(--text-muted);
    padding: 12px 15px;
    font-weight: 600;
}

.custom-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table tr:hover {
    background-color: #f8fafc;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-paid { background: #d1fae5; color: #065f46; }
.badge-due { background: #fee2e2; color: #991b1b; }
.badge-partial { background: #fef3c7; color: #92400e; }

/* MODALS */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--gold-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input, .form-group select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--gold-primary);
}

.form-submit-btn {
    background: var(--gold-gradient);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    width: 100%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

/* Report Tabs & Preset Chips Styling */
.report-tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.report-tab-btn {
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
}

.report-tab-btn:hover {
    color: var(--gold-primary);
    background: #f8fafc;
}

.report-tab-btn.active {
    color: var(--gold-primary);
    border-bottom-color: var(--gold-primary);
    background: #ffffff;
    font-weight: 700;
}

.report-tab-pane {
    display: none;
}

.report-tab-pane.active {
    display: block;
}

.preset-chip {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    background: #e2e8f0;
    color: #334155;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.preset-chip:hover, .preset-chip.active {
    background: var(--gold-primary);
    color: #ffffff;
}

/* RESPONSIVE MEDIA QUERIES FOR MOBILE & TABLETS */
@media screen and (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .sidebar-overlay.active { display: block; }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .header-bar {
        padding: 0 15px;
    }

    .search-box {
        width: 180px;
    }

    .page-container {
        padding: 15px;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }
}

@media screen and (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        display: none;
    }
}

/* =========================================================
   GLOBAL DIRECT BROWSER PRINTING MEDIA STYLES (@media print)
   ========================================================= */
@media print {
    .sidebar, .header-bar, .mobile-menu-btn, .sidebar-overlay,
    .btn-action, .close-btn, .search-box, .report-tabs-nav,
    .quick-actions-bar, .modal-header .close-btn,
    button:not(.printable-keep-btn), select:not(.printable-keep-select) {
        display: none !important;
    }

    body, .main-wrapper, .page-container, .card-box {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
    }

    .custom-table th, .custom-table td {
        border: 1px solid #cbd5e1 !important;
        color: #000000 !important;
    }

    .modal-backdrop.active {
        position: static !important;
        background: none !important;
        backdrop-filter: none !important;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
}
