:root {
    --primary:       #148c64;
    --primary-dark:  #107050;
    --primary-light: #ecfdf5;
    --primary-glow:  rgba(20, 140, 100, 0.15);
    --accent:        #06b6d4;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --surface:       #ffffff;
    --bg:            #f1f5f9;
    --text:          #0f172a;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --bg-light:      #f8fafc;
    --premium-green: #148c64;
    --premium-charcoal: #303f4a;
    --premium-dark: #1e293b;

    --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.04);
    --shadow-primary: 0 4px 14px rgba(20, 140, 100, 0.25);
    --shadow-success: 0 4px 14px rgba(16, 185, 129, 0.25);

    --radius-sm:  6px;
    --radius:     12px;
    --radius-lg:  18px;
    --radius-xl:  24px;
    --radius-pill:99px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 18% 0%, rgba(20, 140, 100, 0.05) 0%, transparent 48%),
        radial-gradient(circle at 82% 100%, rgba(48, 63, 74, 0.05) 0%, transparent 48%);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Global modal position: slightly above center */
.modal-dialog-centered {
    align-items: flex-start !important;
    margin-top: 8vh !important;
}
.modal-dialog:not(.modal-dialog-centered) {
    margin-top: 8vh !important;
}

/* ---- Navbar ---- */
.navbar {
    background: rgba(255,255,255,0.93);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.03);
    padding: 0.55rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1040;
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--primary) !important;
    font-size: 1.05rem;
}

.nav-link {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.5rem 0.8rem !important;
    transition: color var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: calc(100% - 1.2rem);
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--premium-charcoal));
    border-radius: 2px;
    transition: transform var(--transition);
}

.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link:hover::after, .nav-link.active::after { transform: translateX(-50%) scaleX(1); }

/* Landing Custom Navbar */
.navbar-custom {
    background: #ffffff !important;
    backdrop-filter: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-custom.fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

.dropdown-menu {
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,0.03) !important;
    border-radius: var(--radius-lg) !important;
    padding: 0.5rem !important;
    animation: dropdownFadeIn 0.15s ease;
    z-index: 9999 !important;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

.dropdown-item:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md) !important;
    transition: box-shadow var(--transition), transform var(--transition);
    background: var(--surface);
}

.card:hover { box-shadow: var(--shadow-lg) !important; }

.card-header {
    border-bottom: 1px solid var(--border) !important;
    background: transparent !important;
}

.card-header.bg-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-bottom: none !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--premium-charcoal) 100%) !important;
    border-bottom: none !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, #059669 0%, var(--success) 100%) !important;
    border-bottom: none !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #d97706 0%, var(--warning) 100%) !important;
    border-bottom: none !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

/* ---- Buttons ---- */
.btn {
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    transition: all var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--premium-charcoal) 100%);
    border: none !important;
    box-shadow: var(--shadow-primary);
    padding: 0.55rem 1.25rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 6px 20px rgba(79,70,229,0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, var(--success) 100%);
    border: none !important;
    box-shadow: var(--shadow-success);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1.5px solid var(--primary) !important;
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-light {
    background: white;
    border: 1px solid var(--border) !important;
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

.btn-premium {
    background: linear-gradient(135deg, var(--premium-green) 0%, var(--premium-charcoal) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(20, 140, 100, 0.4);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -3px rgba(20, 140, 100, 0.5);
    color: white;
}

.btn-outline-premium {
    border: 2px solid var(--premium-green);
    color: var(--premium-green);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-premium:hover {
    background: var(--premium-green);
    color: white;
}

/* ---- Tables ---- */
.table { font-size: 0.875rem; }

.table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border) !important;
    padding: 0.9rem 1rem;
}

.table-dark thead th {
    color: rgba(255,255,255,0.65) !important;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-bottom: none !important;
}

.table tbody tr:hover { background-color: #f8faff !important; }

.table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* ---- Forms ---- */
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: white;
    box-shadow: var(--shadow-xs);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-sm);
    outline: none;
}

.input-group-text {
    border: 1.5px solid var(--border);
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ---- Badges ---- */
.badge {
    font-weight: 600;
    padding: 0.35em 0.75em;
    font-size: 0.72rem;
}

/* ---- Alerts ---- */
.alert {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md);
}

.alert-success { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: #065f46; }
.alert-danger { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); color: #7f1d1d; }

/* ---- Pagination ---- */
.pagination .page-link {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) !important;
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) forwards; }

/* ---- Utilities ---- */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--premium-charcoal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-premium {
    background: linear-gradient(135deg, var(--primary) 0%, var(--premium-charcoal) 100%);
}

.branch-selector {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border: 1.5px solid #c7d2fe !important;
    color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius-pill) !important;
}

.user-pill {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.75rem 0.3rem 0.4rem;
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--premium-charcoal) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: white;
}

@media print {
    .navbar, .btn, .no-print { display: none !important; }
}

/* ---- Login & Auth ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: 2rem;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(20, 140, 100, 0.6) 0%, rgba(48, 63, 74, 0.4) 100%);
    z-index: 1;
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-xl), 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important; /* Remove default padding for internal sections */
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden; /* Round content inside */
}

.auth-header {
    background: white;
    padding: 2.5rem 2.5rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.auth-body {
    padding: 1.5rem 2.5rem 2.5rem;
}

.auth-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 2.25rem;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.auth-input-group {
    margin-bottom: 1.5rem;
}

.auth-input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}

.auth-form-control {
    display: block !important;
    width: 100% !important;
    background: rgba(241, 245, 249, 0.5) !important;
    border: 1.5px solid var(--border) !important;
    padding: 0.8rem 1.2rem !important;
    font-weight: 500 !important;
}

.auth-form-control:focus {
    background: white !important;
    border-color: var(--primary) !important;
}

.auth-btn {
    padding: 0.8rem !important;
    font-size: 1rem !important;
    border-radius: var(--radius) !important;
    width: 100%;
}

/* ---- Tour Guide (Driver.js) ---- */
.driver-popover.gestorphone-tour-popover {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-radius: var(--radius) !important;
    padding: 1.25rem !important;
    border: 1.5px solid rgba(20, 140, 100, 0.25) !important;
    box-shadow: var(--shadow-xl), 0 20px 30px -10px rgba(0, 0, 0, 0.15) !important;
    max-width: 360px !important;
    font-family: 'Inter', system-ui, sans-serif !important;
}

.driver-popover.gestorphone-tour-popover .driver-popover-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0.45rem !important;
}

.driver-popover.gestorphone-tour-popover .driver-popover-description {
    font-size: 0.875rem !important;
    color: #475569 !important;
    line-height: 1.55 !important;
    margin-bottom: 0.85rem !important;
}

.driver-popover.gestorphone-tour-popover .driver-popover-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
    border-top: 1px solid #f1f5f9 !important;
}

.driver-popover.gestorphone-tour-popover .driver-popover-progress-text {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    background: var(--primary-light) !important;
    padding: 0.2rem 0.55rem !important;
    border-radius: var(--radius-pill) !important;
}

.driver-popover.gestorphone-tour-popover button.driver-popover-next-btn,
.driver-popover.gestorphone-tour-popover button.driver-popover-done-btn {
    background: var(--primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    font-size: 0.825rem !important;
    padding: 0.4rem 0.9rem !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition) !important;
    cursor: pointer !important;
    text-shadow: none !important;
}

.driver-popover.gestorphone-tour-popover button.driver-popover-next-btn:hover,
.driver-popover.gestorphone-tour-popover button.driver-popover-done-btn:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px) !important;
}

.driver-popover.gestorphone-tour-popover button.driver-popover-prev-btn {
    background: #f8fafc !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    font-size: 0.825rem !important;
    padding: 0.4rem 0.8rem !important;
    margin-right: 0.4rem !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    text-shadow: none !important;
}

.driver-popover.gestorphone-tour-popover button.driver-popover-prev-btn:hover {
    background: #e2e8f0 !important;
    color: #334155 !important;
}

.driver-popover.gestorphone-tour-popover button.driver-popover-close-btn {
    color: #94a3b8 !important;
    transition: color var(--transition) !important;
}

.driver-popover.gestorphone-tour-popover button.driver-popover-close-btn:hover {
    color: var(--danger) !important;
}

