/* RotaCerta Logística - Design System and Stylesheet */

:root {
    /* Color Palette */
    --bg-dark: #0a0d14;
    --panel-bg: rgba(20, 26, 38, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-glow: rgba(59, 130, 246, 0.15);
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.4);
    
    --accent: #6366f1;
    --accent-green: #10b981;
    --accent-green-bg: rgba(16, 185, 129, 0.1);
    --accent-red: #f43f5e;
    --accent-red-bg: rgba(244, 63, 94, 0.1);
    --accent-blue-bg: rgba(59, 130, 246, 0.1);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(13, 17, 28, 0.7);
    --input-focus-border: #4f46e5;
    
    /* Font sizes & weights */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Layout */
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Base resets & scrollbar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 13, 20, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Background Glowing Accents */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.45;
}
.spot-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.8) 0%, rgba(99, 102, 241, 0) 70%);
}
.spot-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.8) 0%, rgba(16, 185, 129, 0) 70%);
}
.spot-3 {
    top: 35%;
    left: 45%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.6) 0%, rgba(244, 63, 94, 0) 70%);
}

/* Core Container */
.app-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    margin-bottom: 24px;
    animation: slideDown var(--transition-normal) forwards;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 2rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

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

.user-badge {
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge i {
    color: var(--primary);
}

/* Main Content Views */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.screen {
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
}

.screen.active {
    display: block;
    opacity: 1;
    animation: fadeIn var(--transition-normal) forwards;
}

.hidden {
    display: none !important;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 28px;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45), 0 0 20px 0 var(--panel-glow);
}

/* Typography & Headers */
h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.6rem;
    color: #fff;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.card-header i {
    font-size: 1.5rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.text-accent {
    color: var(--primary);
    filter: drop-shadow(0 0 4px var(--primary-glow));
}

.justify-between {
    justify-content: space-between;
}

.flex-align-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gap-sm {
    gap: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    letter-spacing: 0.3px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

/* Custom Select Styling */
.select-wrapper {
    position: relative;
}
.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
}

select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4), 0 0 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-block {
    width: 100%;
}

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

.btn-icon-only {
    padding: 10px;
    border-radius: 50%;
}

.flex-grow {
    flex-grow: 1;
}

/* Checkbox */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-container .checkmark::after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Badges */
.badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-info {
    background: var(--accent-blue-bg);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-success {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Custom Password Input Toggle */
.password-input-wrapper {
    position: relative;
}
.password-input-wrapper input {
    padding-right: 46px;
}
.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}
.toggle-password:hover {
    color: var(--text-main);
}

/* 1. Login Screen Layout */
#screen-login.active {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 16px;
}

.login-header h2 {
    font-family: var(--font-heading);
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 6px;
}

.profile-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-option .fa-stack {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.profile-option .fa-circle {
    color: rgba(255, 255, 255, 0.06);
    transition: color var(--transition-fast);
}

.profile-option i:not(.fa-stack-1x):not(.fa-stack-2x) {
    color: var(--text-muted);
}

.profile-option:hover {
    color: var(--text-main);
}

.profile-option.active {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-option.active .fa-circle {
    color: var(--primary);
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
    animation: fadeIn var(--transition-fast) forwards;
}

/* 2. Driver & Manager Grid Layouts */
.grid-2-cols,
.grid-2-cols-equal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

#screen-driver .grid-2-cols {
    grid-template-columns: 4.5fr 6.5fr;
    align-items: start;
}

.driver-info-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-item .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-item .value {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.cost-preview-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 24px 0;
}

.preview-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.preview-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.flex-row-center {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

/* Tables styling */
.table-container {
    max-height: 520px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.table-container.large-table {
    max-height: 600px;
}

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

thead {
    position: sticky;
    top: 0;
    background: #151a24;
    z-index: 5;
}

th {
    padding: 14px 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Custom Grid Style for manager entries table */
#table-manager-entries th,
#table-manager-entries td {
    padding: 10px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

#table-manager-entries th:last-child,
#table-manager-entries td:last-child {
    border-right: none;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-bold {
    font-weight: 600;
}

.no-data-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.no-data-msg i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* 3. Manager Screen Layout */
.manager-layout {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: start;
    width: 100%;
    position: relative;
    transition: all 0.3s ease;
}

.manager-sidebar {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: 260px;
    min-height: calc(100vh - 120px);
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    position: sticky;
    top: 24px;
}

.sidebar-header {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 16px;
}

.btn-toggle-sidebar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-fast);
}

.btn-toggle-sidebar:hover {
    background: var(--primary);
    color: white;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    width: 100%;
    align-items: flex-start;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.nav-item i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item:hover i {
    transform: translateY(-1px);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    border-bottom: none;
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.sidebar-footer {
    padding: 20px 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    width: 100%;
}

.manager-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Collapsed Sidebar styles */
.manager-layout.collapsed .manager-sidebar {
    width: 78px;
    padding: 24px 12px;
}

.manager-layout.collapsed .sidebar-header {
    justify-content: center;
}

.manager-layout.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.manager-layout.collapsed .nav-item span {
    display: none;
}

.manager-layout.collapsed .sidebar-footer {
    padding: 20px 0 0 0;
    justify-content: center;
}

.manager-layout.collapsed .sidebar-footer span.manager-badge {
    font-size: 0;
}

.manager-layout.collapsed .sidebar-footer span.manager-badge i {
    font-size: 1.25rem;
    margin: 0;
}

/* Manager Tab views */
.manager-tab-content {
    flex: 1;
    min-width: 0;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn var(--transition-normal) forwards;
}

/* KPI Filter Bar */
.filters-card {
    margin-bottom: 24px;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-main);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

#tab-fuel .filter-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-row .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.filter-quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* KPI Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.metrics-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.metrics-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.metrics-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    height: 100%;
    min-width: 0;
}

.metric-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 14px;
    font-size: 1.4rem;
}

.cost .metric-icon {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.km .metric-icon {
    background: var(--accent-blue-bg);
    color: var(--primary);
}

.pickups .metric-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.fuel .metric-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.metric-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin: 4px 0;
    white-space: nowrap;
}

.metric-trend {
    font-size: 0.75rem;
    line-height: 1.2;
}

.text-neutral {
    color: var(--text-muted);
}

/* Charts Wrapper */
.chart-wrapper {
    min-height: 320px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart-header {
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-header h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.canvas-container {
    position: relative;
    height: 250px;
    width: 100%;
    flex: 1;
}

/* Manager driver page custom layout */
.grid-2-cols-unequal {
    display: grid;
    grid-template-columns: minmax(360px, 4.2fr) minmax(0, 5.8fr);
    gap: 24px;
    align-items: start;
}

.form-actions-row {
    display: flex;
    gap: 12px;
}

/* Table Row Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-edit {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.btn-edit:hover {
    background: var(--primary);
    color: white;
}

.btn-delete {
    color: var(--accent-red);
    background: var(--accent-red-bg);
}

.btn-delete:hover {
    background: var(--accent-red);
    color: white;
}

/* Alerts and Messages */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-top: 16px;
}

.alert-danger {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* Toasts (Notifications) */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    z-index: 100;
    min-width: 280px;
    animation: slideLeft var(--transition-normal) forwards;
}

.toast.hidden {
    display: none;
}

.toast-icon {
    font-size: 1.2rem;
    color: var(--accent-green);
}

.toast-msg {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Footer styling */
.app-footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.app-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { transform: translateY(-16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideLeft {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive grid adjustments */
@media (max-width: 1024px) {
    .grid-2-cols,
    .grid-2-cols-unequal {
        grid-template-columns: 1fr;
    }
    
    .manager-layout {
        flex-direction: column;
    }
    
    .manager-sidebar {
        width: 100% !important;
        min-height: auto !important;
        padding: 12px 24px !important;
        position: static;
    }
    
    .sidebar-header {
        display: none !important;
    }
    
    .sidebar-nav {
        flex-direction: row !important;
        overflow-x: auto;
        padding: 0 8px;
        width: 100% !important;
    }
    
    .nav-item {
        width: auto !important;
        padding: 10px 14px !important;
        white-space: nowrap;
        font-size: 0.85rem;
    }
    
    .nav-item span {
        display: inline !important;
    }
    
    .sidebar-footer {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .metrics-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .metrics-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .metrics-grid,
    .metrics-grid-2,
    .metrics-grid-4,
    .metrics-grid-6 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 4. Fortnightly Settlement Styles */
.settlement-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 16px;
}

.set-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.set-summary-item .label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    font-weight: 500;
}

.set-summary-item .value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.total-geral-pagar-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin: 20px 0;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
    animation: pulseGlow 3s infinite ease-in-out;
}

.total-geral-pagar-box .box-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.total-geral-pagar-box .box-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-green);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.margin-top-lg {
    margin-top: 24px;
}

.margin-bottom-lg {
    margin-bottom: 28px;
}

.table-row-highlight {
    background: rgba(59, 130, 246, 0.08) !important;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.table-row-highlight td {
    color: #fff !important;
}

/* Animations */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.35); }
    50% { box-shadow: 0 0 32px rgba(16, 185, 129, 0.3); border-color: rgba(16, 185, 129, 0.7); }
}

/* Modal Overlay & Modal Card CSS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 12, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity var(--transition-normal);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.modal-card {
    border-radius: var(--radius-lg);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Custom CSS Tooltips for Dashboard Cards */
.metric-card {
    position: relative;
}

.metric-card[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(10, 13, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast) ease, transform var(--transition-fast) ease;
    box-shadow: var(--shadow-premium);
    text-align: center;
}

.metric-card[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: rgba(10, 13, 20, 0.95) transparent transparent;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast) ease, transform var(--transition-fast) ease;
}

.metric-card[data-tooltip]:hover::before,
.metric-card[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* SSW Import styles */
.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--primary) !important;
    background: rgba(59, 130, 246, 0.08) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15) !important;
}

.warning-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.warning-item {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn var(--transition-fast) forwards;
}

.warning-item.loss {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--accent-red);
}

.ranking-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-main) !important;
}

.ranking-tab-btn.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* Viewer Mode (Read-only) Styles */
body.viewer-mode .btn-edit,
body.viewer-mode .btn-delete,
body.viewer-mode .btn-action-delete,
body.viewer-mode .btn-delete-import,
body.viewer-mode #btn-settle-payment,
body.viewer-mode #btn-delete-paid,
body.viewer-mode #btn-trigger-import,
body.viewer-mode #tab-drivers table th:last-child,
body.viewer-mode #tab-drivers table td:last-child,
body.viewer-mode #tab-entries table th:last-child,
body.viewer-mode #tab-entries table td:last-child,
body.viewer-mode #table-import-history th:last-child,
body.viewer-mode #table-import-history td:last-child,
body.viewer-mode .sidebar-nav button[data-target="tab-new-entry-manager"],
body.viewer-mode .sidebar-nav button[data-target="tab-import-ssw"],
body.viewer-mode #tab-drivers .grid-2-cols-unequal > .glass-panel:first-child {
    display: none !important;
}

body.viewer-mode .grid-2-cols-unequal {
    grid-template-columns: 1fr !important;
}

body.master-mode .manager-badge {
    color: #f59e0b !important; /* amber/gold */
}

/* Table overflow scrolling fixes */
.table-container {
    overflow-x: auto !important; /* Allow tables to scroll horizontally inside cards */
}

.table-responsive {
    overflow-x: auto !important;
    max-width: 100%;
}

/* Notebook & Laptop Layout Optimizations (widths between 1025px and 1366px) */
@media (max-width: 1366px) {
    .app-container {
        padding: 16px;
    }
    
    .manager-layout {
        gap: 16px;
    }
    
    .manager-sidebar {
        width: 220px;
        padding: 16px 12px;
    }
    
    .nav-item {
        padding: 10px 12px;
        font-size: 0.9rem;
        gap: 8px;
    }
    
    .grid-2-cols {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .grid-2-cols-unequal {
        grid-template-columns: 1fr 1.2fr;
        gap: 16px;
    }
    
    .metrics-grid-6 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px;
    }
    
    .metrics-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
}

/* Tablet & Mobile stacking threshold (below 960px) */
@media (max-width: 960px) {
    .filter-row,
    #tab-fuel .filter-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2-cols,
    .grid-2-cols-unequal,
    .grid-2-cols-equal {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .manager-sidebar {
        width: 100% !important;
        min-height: auto !important;
        position: static;
        padding: 12px 16px !important;
    }
    
    .manager-layout {
        flex-direction: column;
    }
    
    .sidebar-header {
        display: none !important;
    }
    
    .sidebar-nav {
        flex-direction: row !important;
        overflow-x: auto;
        padding: 0 4px;
        width: 100% !important;
        gap: 8px;
    }
    
    .nav-item {
        width: auto !important;
        white-space: nowrap;
    }
    
    .sidebar-footer {
        display: none !important;
    }
}

/* Presentation / Landing Page Custom Aesthetics */
#screen-landing {
    padding: 20px 0;
}

#screen-landing .glass-panel {
    background: rgba(13, 18, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.feature-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-5px) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15) !important;
}

@media (max-width: 1024px) {
    .feature-grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .feature-grid-3 {
        grid-template-columns: 1fr !important;
    }
}



