@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Primary Accent Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eeeffe;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    --accent-glow: rgba(79, 70, 229, 0.15);

    /* Backgrounds & Surfaces */
    --bg-body: #f8fafc;
    --surface: #ffffff;
    --surface-secondary: #f1f5f9;

    /* Sidebar Dark Theme */
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: rgba(79, 70, 229, 0.25);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;

    /* Text Colors */
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;

    /* Borders & Shadows */
    --border-color: #e2e8f0;
    --border-color-light: #f1f5f9;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
}

/* Base resets & typography */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
}

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

/* Sidebar Styling - Compact & Modern */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    border-right: 1px solid var(--sidebar-border);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 16px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    display: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.sidebar-close-btn:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.workspace-switcher {
    margin: 0 2px 14px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    font-size: 0.8rem;
}

.workspace-switcher .label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.workspace-switcher .workspace-name {
    color: #f8fafc;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav-category {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #64748b;
    text-transform: uppercase;
    padding: 10px 10px 4px;
}

.sidebar-nav a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.sidebar-nav a i {
    font-size: 1rem;
    color: #64748b;
    transition: color 0.15s ease;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-nav a:hover i {
    color: #cbd5e1;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.2) 0%, rgba(79, 70, 229, 0.05) 100%);
    color: #ffffff;
    font-weight: 600;
    border-left: 3px solid var(--primary);
    padding-left: 7px;
}

.sidebar-nav a.active i {
    color: #818cf8;
}

.sidebar-user {
    border-top: 1px solid var(--sidebar-border);
    padding: 12px 6px 0;
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-user-info strong {
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.825rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info small {
    color: #64748b;
    font-size: 0.725rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main Content Layout */
.main-content {
    margin-left: 240px;
    width: calc(100% - 240px);
    padding: 24px 28px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Mobile Header Topbar */
.mobile-top-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid var(--sidebar-border);
}

.mobile-top-bar .sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Top App Bar Header */
.top-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.page-header-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.page-header-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 2px 0 0;
}

/* Cards & Surface Container */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

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

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: #dcfce7; color: #16a34a; }
.stat-icon.warning { background: #fef3c7; color: #d97706; }
.stat-icon.info { background: #e0f2fe; color: #0284c7; }

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-heading);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card .stat-desc {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

/* Custom Responsive Table Container */
.table-responsive {
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    background: #ffffff;
}

/* Custom Scrollbar for Tables */
.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
    color: var(--text-body);
    width: 100%;
}

.table > :not(caption) > * > * {
    padding: 12px 14px;
    border-bottom-color: var(--border-color-light);
}

.table thead th {
    background: #f8fafc;
    font-family: var(--font-display);
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

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

.zuvoo-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Avatar Badges & Icons */
.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-circle.company {
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 6px;
}

/* Buttons Polish */
.btn {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.775rem;
    border-radius: 5px;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-light {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-heading);
}

.btn-light:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--text-heading);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* Form Controls Polish */
.form-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.form-control, .form-select {
    font-family: var(--font-body);
    font-size: 0.875rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: var(--text-heading);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: 0;
}

.input-group-text {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.875rem;
}

/* Badges Polish */
.badge {
    font-family: var(--font-display);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.725rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.text-bg-success, .badge-success {
    background-color: #dcfce7 !important;
    color: #15803d !important;
}

.text-bg-primary, .badge-primary {
    background-color: #e0e7ff !important;
    color: #4338ca !important;
}

.text-bg-danger, .badge-danger {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

.text-bg-secondary, .badge-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.text-bg-light {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0;
}

/* Alerts Polish */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 12px 16px;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.alert-success { background: #dcfce7; color: #14532d; }
.alert-danger { background: #fee2e2; color: #7f1d1d; }
.alert-warning { background: #fef3c7; color: #78350f; }
.alert-info { background: #e0f2fe; color: #0c4a6e; }

/* Authentication Pages Redesign */
.auth-page {
    min-height: 100vh;
    background: #0f172a;
    font-family: var(--font-body);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.auth-brand-panel {
    padding: 48px 8%;
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.35) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 40%),
                linear-gradient(145deg, #090d16 0%, #0f172a 60%, #1e1b4b 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
}

.auth-brand .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
}

.auth-copy {
    max-width: 520px;
    margin-top: 8vh;
}

.auth-eyebrow {
    color: #818cf8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-copy h1 {
    color: #ffffff;
    font-size: clamp(26px, 3vw, 44px);
    line-height: 1.15;
    margin: 16px 0;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-copy p {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1.6;
}

.auth-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

.auth-points-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.auth-points-item i {
    color: #818cf8;
    font-size: 1.1rem;
}

.auth-footer {
    color: #64748b;
    font-size: 0.8rem;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #ffffff;
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 20px;
    color: #94a3b8;
    font-size: 0.8rem;
}

.auth-divider::before, .auth-divider::after {
    content: "";
    height: 1px;
    background: #e2e8f0;
    flex: 1;
}

/* Responsive Media Queries */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-close-btn {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 16px 14px 32px;
    }

    .mobile-top-bar {
        display: flex;
    }

    .top-app-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .page-header-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 899.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        min-height: 100vh;
        padding: 24px 16px;
        background: #f8fafc;
    }

    .auth-form-wrap {
        background: #ffffff;
        padding: 24px 20px;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
        border: 1px solid var(--border-color);
    }
}
