/* assets/css/style.css */
:root {
    --primary-color: #0f172a;
    --secondary-color: #3b82f6;
    --accent-color: #f59e0b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f5a623;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 88px;
    --header-height: 70px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

.financial-item {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utility */
.text-primary {
    color: var(--secondary-color) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-success {
    color: var(--success) !important;
}

.mt-auto {
    margin-top: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Login Page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.login-card {
    background: var(--bg-white);
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 2rem;
    font-weight: 100;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.login-logo img {
    max-width: 180px;
    max-height: 60px;
    height: auto;
    align-items: center;
}

.login-logo span span {
    color: var(--secondary-color);
}

.login-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #475569;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 2.5rem;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-card .btn-primary {
    height: 48px;
    font-size: 1rem;
}

.form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
}


/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #f1f5f9 0%, #cbd5e1 50%, #94a3b8 100%);
    background-attachment: fixed;
}

body.dark-theme .app-container {
    background: radial-gradient(circle at top right, #0f172a 0%, #1e293b 50%, #020617 100%);
}

/* Navbar */
.navbar {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

body.dark-theme .navbar {
    background-color: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
}

.sidebar-toggle:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    background: transparent !important;
}

.logo img {
    max-height: 40px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.logo span span {
    color: var(--secondary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.user-profile:hover {
    background-color: var(--bg-light);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}

body.dark-theme .user-name {
    color: var(--text-main);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: var(--transition);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 1100;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Styles for when sidebar is collapsed */
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .menu-text {
    display: none;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
}

.sidebar-mini-logo {
    display: none;
    /* Hidden by default */
    text-align: center;
    padding: 15px 0;
    font-size: 1.5rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: -1.5rem -0.5rem 1.5rem -0.5rem;
    /* Adjust to fill space */
}

.sidebar.collapsed .sidebar-mini-logo {
    display: block;
    /* Shown when collapsed */
}

.menu-section {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 600;
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: #cbd5e1;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}

.menu-item:hover,
.menu-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    transition: var(--transition);
    min-height: calc(100vh - var(--header-height));
    background: transparent;
}

.main-content.expanded {
    margin-left: var(--sidebar-width-collapsed);
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

body.dark-theme .page-title {
    color: var(--text-main);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Cards & Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.card {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    overflow: hidden;
}

body.dark-theme .card {
    background-color: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.card-body {
    padding: 1.5rem;
}

/* Dashboard specific */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    /* Force 6 equal columns even on smaller screens */
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 3rem;
    padding-top: 10px;
    /* Space for the lift animation */
    overflow: visible;
    align-items: stretch;
}

.dashboard-row .stat-card {
    margin-bottom: 0;
    height: 100%;
    min-width: 0;
    /* Forces content to shrink rather than expanding the grid track */
}

/* Tablet: 3 cards per row - Adjusted breakpoint to keep single row longer on desktop */
@media (max-width: 1100px) {
    .dashboard-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small Tablet: 2 cards per row */
@media (max-width: 600px) {
    .dashboard-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 card per row */
@media (max-width: 400px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0.75rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Subtle, semi-transparent border */
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    z-index: 100;
    border-color: var(--secondary-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-icon.blue {
    background-color: #eff6ff;
    color: #3b82f6;
}

.stat-icon.green {
    background-color: #ecfdf5;
    color: #10b981;
}

.stat-icon.orange {
    background-color: #fff7ed;
    color: #f97316;
}

.stat-icon.purple {
    background-color: #f5f3ff;
    color: #8b5cf6;
}

.stat-icon.red {
    background-color: #fef2f2;
    color: #ef4444;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    /* Smaller font to ensure labels don't wrap */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stat-value {
    font-size: 1.1rem;
    /* Slightly smaller value text for density */
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Financial Summary Cards (Supplier Payable Page) */
.summary-container {
    display: flex;
    gap: 24px;
    width: 100%;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.summary-card {
    flex: 1;
    min-width: 260px;
    background: var(--bg-white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.summary-card:hover {
    box-shadow: var(--shadow-md);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.icon-blue {
    background-color: #eff6ff;
    color: #3b82f6;
}

.icon-green {
    background-color: #ecfdf5;
    color: #10b981;
}

.icon-red {
    background-color: #fef2f2;
    color: #ef4444;
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 4px;
}

.summary-amount {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Modal Styles */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;

    background-color: var(--bg-light);
}

.table td {
    font-size: 0.95rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--bg-light);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: #ecfdf5;
    color: #065f46;
}

.badge-danger {
    background-color: #fef2f2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fffbeb;
    color: #b45309;
}

.badge-primary {
    background-color: #eff6ff;
    color: #1e40af;
}

/* Dark Theme & Toggle Button */
body.dark-theme {
    --bg-light: #1e293b;
    /* Dark blue-grey background */
    --bg-white: #334155;
    /* Lighter dark blue-grey for cards */
    --text-main: #ffffff;
    /* Light grey text */
    --text-muted: #e2e8f0;
    /* Lighter grey text */
    --border-color: #475569;
    /* Mid-grey border */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --bg-overlay: rgba(0, 0, 0, 0.5);
}

body.dark-theme .card-title,
body.dark-theme .stat-value {
    color: var(--text-main);
}

/* Enforce white text for elements with hardcoded colors */
body.dark-theme .form-label,
body.dark-theme .summary-label,
body.dark-theme label,
body.dark-theme .flight-header span,
body.dark-theme .flight-details li strong {
    color: var(--text-main);
}

body.dark-theme .text-muted {
    color: var(--text-muted);
}

/* Force dark background for specific containers in dark mode */
body.dark-theme .flight-container,
body.dark-theme .stat-card,
body.dark-theme .summary-card {
    background-color: var(--bg-white) !important;
    color: var(--text-main) !important;
}

/* Dark Theme specific text fixes */
body.dark-theme .logo,
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3 {
    color: var(--text-main);
}

body.dark-theme .form-control {
    background-color: var(--bg-white);
    color: var(--text-main);
    border-color: var(--border-color);
}

body.dark-theme .form-control::placeholder {
    color: var(--text-muted);
}

body.dark-theme .form-control:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

body.dark-theme .search-bar-container {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}


.theme-toggle,
.search-toggle,
.currency-converter-toggle,
.notification-toggle {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    position: relative;
}

.theme-toggle:hover,
.search-toggle:hover,
.notification-toggle:hover {
    background-color: var(--bg-light) !important;
    color: var(--primary-color) !important;
    border-color: var(--secondary-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--bg-white);
}

/* Notification Dropdown */
.notification-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    right: -100px;
    /* Align slightly to the left relative to button center */
    width: 320px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1050;
    flex-direction: column;
    overflow: hidden;
}

.notification-dropdown.active {
    display: flex;
    animation: dropDownPremium 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-light);
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.notif-icon-wrapper {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    color: var(--secondary-color);
}

.notif-content {
    display: flex;
    flex-direction: column;
}

.notif-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.mark-read-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
}

.mark-read-btn:hover {
    text-decoration: underline;
}

.search-bar-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    display: flex;
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    z-index: 950;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transform: translateY(-150%);
    pointer-events: none;
    transition: transform 0.3s ease-in-out;
    visibility: hidden;
}

.search-bar-container.active {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

.search-input-group {
    display: flex;
    width: 100%;
    max-width: 600px;
    gap: 0.5rem;
}