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

.icon-spin {
    animation: icon-spin 0.8s linear infinite;
}
@keyframes icon-spin {
    to { transform: rotate(360deg); }
}

:root {
    --primary-color: #0F766E;
    /* Matches Ride Hailing Logo and Active states */
    --background-color: #F6F6F6;
    /* Matches Figma background */
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --text-primary: #121212;
    --text-secondary: #666666;
    --border-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-primary);
    overflow: hidden;
    /* Main container handles scroll */
}

/* Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    flex-shrink: 0;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 32px 0 32px 0;
    text-align: center;
    letter-spacing: -0.5px;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: #4B5563;
    /* Slightly darker grey for better contrast */
    font-weight: 500;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.2s;
    gap: 16px;
}

/* Sidebar menu icons - only these change color on active */
.sidebar .menu-link i:first-child,
.sidebar .menu-link .menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar .menu-link .menu-icon {
    color: #666666;
}
.sidebar .menu-link .menu-icon img,
.sidebar .menu-link .menu-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.sidebar .menu-link.active {
    background-color: var(--primary-color);
    color: #FFFFFF;
}

.sidebar .menu-link.active .menu-icon {
    color: #FFFFFF;
}

.sidebar .menu-link:hover:not(.active) {
    background-color: #F8FAFC;
}

.sidebar .menu-item.has-submenu .submenu-arrow {
    transition: transform 0.3s;
    margin-left: auto;
    font-size: 12px;
}

.sidebar .menu-item.has-submenu .submenu-arrow {
    color: #666666;
}
.sidebar .menu-item.has-submenu .submenu-arrow img,
.sidebar .menu-item.has-submenu .submenu-arrow svg {
    width: 12px;
    height: 12px;
    transition: color 0.2s ease;
}

.sidebar .menu-link.active .submenu-arrow {
    color: #FFFFFF;
}

.menu-item.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

/* Submenu Styles */
.sub-menu {
    list-style: none;
    padding: 8px 0 8px 0;
    margin: 0;
    display: none;
}

.menu-item.open .sub-menu {
    display: block;
}

.sub-menu-item {
    margin-bottom: 4px;
    padding-left: 12px;
}

.sub-menu-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #6B7280;
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
    border-radius: 8px;
}

.sidebar .sub-menu-link .menu-icon {
    color: #666666;
}
.sidebar .sub-menu-link i,
.sidebar .sub-menu-link .menu-icon img,
.sidebar .sub-menu-link .menu-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.sidebar .sub-menu-link.active {
    background-color: #F0FDFA;
    color: var(--primary-color);
}

.sidebar .sub-menu-link.active .menu-icon {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    height: 80px;
    /* Matched Figma 81px roughly */
    background-color: var(--background-color);
    /* Grey background as per screenshot */
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
}

.search-bar {
    position: relative;
    width: 380px;
    /* Wider search bar */
}

.search-bar input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 52px;
    /* Left padding for icon + spacing to prevent overlap */
    border: none;
    background-color: #FFFFFF;
    /* White background */
    border-radius: 8px;
    font-family: 'Inter';
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.search-bar input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.search-bar i,
.search-bar .header-icon,
.search-bar img:first-child {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.4);
    font-size: 18px;
    pointer-events: none;
}

.search-bar .header-icon img,
.search-bar img:first-child {
    width: 20px;
    height: 20px;
    display: block;
    filter: none; /* Keep original icon colors */
}

/* Header icons - always use original SVG colors, no overrides */
.header .header-icon img,
.header .chevron-icon img {
    filter: none !important;
}

.header .chevron-icon img {
    width: 14px;
    height: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    height: 100%;
}

.notification-bell {
    position: relative;
    margin-right: 24px;
    padding-right: 24px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    /* Vertical Divider */
    height: 32px;
    display: flex;
    align-items: center;
}

.notification-bell i,
.notification-bell .header-icon {
    font-size: 24px;
    color: #5F6868;
    cursor: pointer;
}

.notification-bell .header-icon img {
    width: 24px;
    height: 24px;
    display: block;
    filter: none; /* Keep original icon colors */
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 22px;
    background: #FF3131;
    color: white;
    font-size: 10px;
    font-weight: bold;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--background-color);
}

.user-info {
    text-align: left;
    /* Text aligns left */
    margin-left: 12px;
    /* Space from Avatar */
    margin-right: 12px;
    /* Space from Chevron */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-name {
    font-family: 'Inter';
    font-weight: 600;
    font-size: 14px;
    color: #303030;
    line-height: 1.4;
    display: block;
}

.user-role {
    font-family: 'Inter';
    font-weight: 400;
    font-size: 12px;
    color: #666666;
    line-height: 1.2;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0;
    /* Removed right margin */
}

.chevron-icon {
    font-size: 16px;
    color: #2B3942;
    cursor: pointer;
}

.chevron-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Content Area */
.content-area {
    flex: 1;
    /* Key for vertical scroll */
    overflow-y: auto;
    /* Allow vertical scroll */
    padding: 32px;
}

.dashboard-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    /* Increased radius */
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    /* Fixed height for consistency */
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

/* Icon Styles */
.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Circle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-passengers {
    background-color: #F0F5FF;
    /* Light Blue */
    color: #3B82F6;
    /* Blue */
}

.icon-drivers {
    background-color: #FDF2F8;
    /* Light Pink */
    color: #DB2777;
    /* Pink */
}

.icon-active {
    background-color: #ECFDF5;
    /* Light Green */
    color: #10B981;
    /* Emerald */
}

.icon-revenue {
    background-color: #E0F2FE;
    /* Light Cyan */
    color: #06B6D4;
    /* Cyan */
}

/* Actions - arrow button: compact, dark green arrow, light gray rounded square */
.stat-arrow-box {
    width: 28px;
    height: 28px;
    background: #F3F4F6;
    /* Very faint gray */
    border-radius: 10px;
    /* Significantly rounded (squircle-like) */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #166534;
    /* Dark green arrow */
    flex-shrink: 0;
    cursor: pointer;
}

.stat-arrow-box svg {
    width: 12px;
    height: 12px;
}

/* Content */
.stat-content-wrapper {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Space between label and value */
}

.stat-label {
    font-size: 14px;
    color: #64748B;
    /* Slate 500 */
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #0F172A;
    /* Slate 900 */
    text-align: right;
    /* Aligned to right */
    align-self: flex-end;
    line-height: 1;
}


/* Charts and Maps Section */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Chart bigger than Map */
    gap: 24px;
    margin-bottom: 32px;
    height: 400px;
}

.chart-section,
.map-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: flex-start;
    /* Start from left */
    align-items: center;
    margin-bottom: 24px;
    height: auto;
}

/* header-left-group is removed */

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #121212;
    margin-bottom: 0;
    margin-right: 48px;
    /* Force gap between Title and Legend */
}

.chart-legend {
    display: flex;
    flex-direction: row;
    /* HStack */
    gap: 24px;
    font-size: 14px;
    color: #666666;
    margin-left: 0;
    margin-top: 6px;
    /* "Little below offset" */
    margin-right: auto;
    /* Push remaining items (Menu) to far right */
}

/* Ensure right alignment for headers without legends */
.header-actions {
    margin-left: auto;
    color: #9CA3AF;
    cursor: pointer;
}

.table-controls {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.control-item {
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4B5563;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.control-item:hover {
    background-color: #F3F4F6;
    border-color: #D1D5DB;
}

.search-input-box {
    padding: 8px 12px;
    width: 240px;
    /* Specific width for search */
    cursor: text;
}

.search-input-box i {
    color: #9CA3AF;
}

.search-input-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: #111827;
}

.search-input-box input::placeholder {
    color: #9CA3AF;
}

.dropdown-btn i {
    font-size: 12px;
    color: #6B7280;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.menu-icon {
    color: #9CA3AF;
    /* Grey color for three dots */
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.chart-container-inner {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}


/* Driver Table */
.table-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 32px;
}

.table-controls {
    display: flex;
    gap: 12px;
}

.dropdown {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #FFFFFF;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
}

th {
    text-align: left;
    padding: 12px 16px;
    background-color: #F9FAFB;
    color: #6B7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

th:first-child {
    border-top-left-radius: 8px;
}

th:last-child {
    border-top-right-radius: 8px;
}

td {
    padding: 16px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* User Column */
.driver-info-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.driver-details {
    display: flex;
    flex-direction: column;
}

.driver-name {
    font-weight: 500;
    color: var(--text-primary);
}

.driver-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Rating */
.rating-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.star-icon {
    color: #F59E0B;
    /* Yellow */
}

/* Status Badges */
.badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.badge-active {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.badge-suspended {
    background-color: #FFF7ED;
    color: #F97316;
}

/* Improved Status Badges for Passenger Table */
.status-badge {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
}

.status-active {
    background-color: #ECFFE2;
    color: #3D9F0A;
}

.status-suspended {
    background-color: #FFF4E5;
    color: #F97316;
}

.status-blocked {
    background-color: #FEE2E2;
    color: #EF4444;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #F6F6F6;
    padding: 15px 16px;
    color: #61677F;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    /* Match uppercase from Screenshot */
    letter-spacing: normal;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sort-icon {
    font-size: 12px;
    color: #9CA3AF;
    margin-left: 4px;
    cursor: pointer;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: #4F5867;
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-name {
    font-weight: 500;
    color: #303030;
    font-size: 14px;
}

.action-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}