/* assets/css/style.css - SAP / Enterprise Light ERP Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    /* SAP / Enterprise Cool Light Palette */
    --bg-app: #f1f5f9;
    --sidebar-bg: #0f172a; /* Slate 900 */
    --sidebar-hover: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: #2563eb;
    --sidebar-active-text: #ffffff;
    
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --primary: #2563eb; /* Enterprise SAP Blue */
    --primary-hover: #1d4ed8;
    --accent-gold: #d97706;
    --accent-gold-bg: #fef3c7;
    
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #ea580c;
    --warning-bg: #ffedd5;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
}

/* App Wrapper Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Left Sidebar for Desktop */
.app-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand span {
    color: #60a5fa;
}

.sidebar-nav {
    padding: 1.25rem 0.75rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    padding: 12px 12px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sidebar-link i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #f8fafc;
}

.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Main Content Wrapper */
.app-main {
    margin-left: 260px;
    width: calc(100% - 260px);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top App Header Bar */
.app-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.topbar-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Main Container Area */
.app-content {
    padding: 2rem;
    flex: 1;
}

/* SAP Cards & Containers */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

/* SAP Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-accent {
    background: #0f172a;
    color: #ffffff;
}

.btn-accent:hover {
    background: #1e293b;
}

.btn-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-disabled, .btn:disabled {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.4rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-info h4 {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.stat-info h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

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

.custom-table th {
    background: #f8fafc;
    padding: 12px 16px;
    color: #475569;
    font-weight: 700;
    border-bottom: 1px solid var(--card-border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text-main);
}

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

/* Status Badges */
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-active, .badge-approved {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.badge-pending {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid #fed7aa;
}

.badge-rejected, .badge-booked {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
    background: #e2e8f0;
    padding: 4px;
    border-radius: var(--radius-md);
    width: fit-content;
}

.filter-tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 6px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

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

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

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

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

/* Badges */
.notification-badge {
    background: var(--danger);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 800;
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Automatic Mobile Table Responsiveness */
.card, .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.custom-table {
    min-width: 680px;
}

/* Responsive Mobile & Tablet Handling for Internal Portal Pages */
@media (max-width: 900px) {
    .mobile-sidebar-toggle { display: flex !important; }
    .app-sidebar {
        display: none;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 270px;
        z-index: 9999;
        box-shadow: 5px 0 25px rgba(0,0,0,0.3);
    }
    .app-sidebar.active { display: flex !important; }
    .app-main { margin-left: 0 !important; width: 100% !important; }
    .app-topbar { padding: 0.8rem 1rem !important; flex-wrap: wrap; gap: 10px; }
    .app-content { padding: 1rem !important; }
    
    .stats-grid, .stat-cards-grid, .grid-3, .grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
        gap: 12px !important;
    }

    .topbar-right {
        gap: 8px !important;
        flex-wrap: wrap;
    }
    .user-profile-badge {
        font-size: 0.78rem !important;
        padding: 4px 10px !important;
    }

    .modal-content, .modal-content-box {
        width: 95% !important;
        max-width: 500px !important;
        padding: 1.2rem !important;
    }

    /* Stack flex rows & filter bars on mobile */
    div[style*="display:flex"], div[style*="display: flex"] {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    .stat-card {
        padding: 1rem !important;
        gap: 12px !important;
    }
    .stat-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }
    .stat-info h2 {
        font-size: 1.3rem !important;
    }
    .topbar-title h3 {
        font-size: 0.9rem !important;
    }
}
