/* ==========================================================================
   Renewal Reminder WebApp - Modern Minimal Design System
   ========================================================================== */

/* ==========================================================================
   1. Design Tokens (CSS Variables)
   ========================================================================== */

:root {
    /* Sidebar colors */
    --sidebar-bg: #0f172a;
    --sidebar-bg-hover: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #e2e8f0;
    --sidebar-text-active: #ffffff;
    --sidebar-accent: #6366f1;
    --sidebar-border: #1e293b;

    /* Main colors */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: #eef2ff;

    /* Status colors (softer palette) */
    --color-success: #10b981;
    --color-success-light: #ecfdf5;
    --color-warning: #f59e0b;
    --color-warning-light: #fffbeb;
    --color-danger: #f43f5e;
    --color-danger-light: #fff1f2;
    --color-info: #0ea5e9;
    --color-info-light: #f0f9ff;

    /* Neutral colors */
    --color-bg: #f8fafc;
    --color-bg-alt: #f1f5f9;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;

    /* Text colors */
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;

    /* Spacing */
    --sidebar-width: 256px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;
    --content-padding: 2rem;
    --content-padding-mobile: 1rem;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --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);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* ==========================================================================
   2. Base Styles
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
}

/* ==========================================================================
   3. Sidebar Layout
   ========================================================================== */

body.has-sidebar {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition-normal);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--sidebar-text-active);
    font-weight: 600;
    font-size: 1.125rem;
    white-space: nowrap;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--sidebar-accent);
    flex-shrink: 0;
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    visibility: hidden;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list-bottom {
    margin-top: auto;
}

.nav-item {
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-bg-hover);
}

.nav-link.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-accent);
}

.nav-link-button {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.nav-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.nav-text {
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    visibility: hidden;
    position: absolute;
}

.nav-badge {
    margin-left: auto;
    background: var(--color-danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    min-width: 1.25rem;
    text-align: center;
}

.sidebar.collapsed .nav-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    margin-left: 0;
}

/* User avatar in nav */
.nav-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--sidebar-accent), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

/* Nav divider */
.nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 1rem 1.5rem;
}

.sidebar.collapsed .nav-divider {
    margin: 1rem 0.75rem;
}

/* Sidebar toggle button */
.sidebar-toggle {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg-hover);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-accent);
}

.sidebar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

body.has-sidebar.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--content-padding);
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
}

.mobile-menu-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
    background: var(--color-bg-alt);
}

.mobile-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.mobile-notification {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    font-size: 1.25rem;
    border-radius: var(--radius-sm);
}

.mobile-notification:hover {
    background: var(--color-bg-alt);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ==========================================================================
   4. Public Layout (Unauthenticated)
   ========================================================================== */

.public-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
}

.public-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--color-text);
    text-decoration: none;
}

.public-brand i {
    color: var(--color-primary);
    font-size: 1.5rem;
}

.public-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.public-main {
    flex: 1;
    min-height: calc(100vh - 140px);
}

.public-footer {
    background: var(--color-bg-alt);
    padding: 1.5rem 0;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* ==========================================================================
   5. Cards
   ========================================================================== */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: transparent;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* Stat Cards */
.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.stat-card .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

.stat-card.stat-total .stat-icon {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.stat-card.stat-expired .stat-icon {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.stat-card.stat-expiring .stat-icon {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.stat-card.stat-active .stat-icon {
    background: var(--color-success-light);
    color: var(--color-success);
}

/* Reminder Cards */
.reminder-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition-fast);
}

.reminder-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.reminder-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.reminder-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.reminder-card-icon.vehicle {
    background: var(--color-info-light);
    color: var(--color-info);
}

.reminder-card-icon.license {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.reminder-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.reminder-card-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.reminder-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-light);
}

/* Plan Cards (Subscription) */
.plan-card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.plan-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.plan-card.selected,
.plan-card.current {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.plan-card .plan-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.plan-card .plan-price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.plan-card .plan-period {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.plan-card .plan-savings {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-success-light);
    color: var(--color-success);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

/* ==========================================================================
   6. Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Primary Button */
.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: white;
}

/* Secondary/Outline Button */
.btn-secondary,
.btn-outline-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    background: var(--color-bg-alt);
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--color-text);
}

.btn-ghost:hover {
    background: var(--color-bg-alt);
}

/* Outline Primary */
.btn-outline-primary {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline-primary:hover {
    background: var(--color-primary);
    color: white;
}

/* Danger Button */
.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #e11d48;
    color: white;
}

.btn-outline-danger {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.btn-outline-danger:hover {
    background: var(--color-danger);
    color: white;
}

/* Success Button */
.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* Icon Button */
.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 2rem;
    height: 2rem;
}

/* ==========================================================================
   7. Forms
   ========================================================================== */

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

.form-control:disabled {
    background: var(--color-bg-alt);
    cursor: not-allowed;
}

/* Select */
.form-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 1rem center/12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    appearance: none;
    transition: all var(--transition-fast);
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Checkbox & Radio */
.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    border: 1.5px solid var(--color-border);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Form validation */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--color-danger);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

.invalid-feedback {
    color: var(--color-danger);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

.text-danger {
    color: var(--color-danger) !important;
}

/* Input Group */
.input-group {
    display: flex;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-text {
    padding: 0.75rem 1rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

/* ==========================================================================
   8. Tables
   ========================================================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--color-bg);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   9. Badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-primary,
.bg-primary {
    background: var(--color-primary-light) !important;
    color: var(--color-primary) !important;
}

.badge-success,
.bg-success,
.badge-active {
    background: var(--color-success-light) !important;
    color: var(--color-success) !important;
}

.badge-warning,
.bg-warning,
.badge-expiring-soon {
    background: var(--color-warning-light) !important;
    color: #b45309 !important;
}

.badge-danger,
.bg-danger,
.badge-expired,
.badge-critical {
    background: var(--color-danger-light) !important;
    color: var(--color-danger) !important;
}

.badge-info,
.bg-info {
    background: var(--color-info-light) !important;
    color: var(--color-info) !important;
}

.badge-secondary,
.bg-secondary {
    background: var(--color-bg-alt) !important;
    color: var(--color-text-secondary) !important;
}

/* ==========================================================================
   10. Alerts
   ========================================================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: var(--color-success-light);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: var(--color-warning-light);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: var(--color-danger-light);
    color: #be123c;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.alert-info {
    background: var(--color-info-light);
    color: #0369a1;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ==========================================================================
   11. Auth Pages
   ========================================================================== */

.auth-container {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card .card-body {
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--color-text-secondary);
    margin: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ==========================================================================
   12. Empty States
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    color: var(--color-text-muted);
    font-size: 2rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   13. Notifications
   ========================================================================== */

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: var(--color-bg-alt);
}

.notification-item.unread {
    background: var(--color-primary-light);
    border-left-color: var(--color-primary);
}

.notification-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.vehicle {
    background: var(--color-info-light);
    color: var(--color-info);
}

.notification-icon.license {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.notification-text {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   14. Profile
   ========================================================================== */

.profile-avatar {
    width: 5rem;
    height: 5rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.profile-avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
}

/* ==========================================================================
   15. Toast Notifications
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    min-width: 300px;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   16. Loading
   ========================================================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   17. Page Headers
   ========================================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* ==========================================================================
   18. Dropdown
   ========================================================================== */

.dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 10rem;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-item:hover {
    background: var(--color-bg-alt);
    color: var(--color-text);
}

.dropdown-item.text-danger {
    color: var(--color-danger);
}

.dropdown-item.text-danger:hover {
    background: var(--color-danger-light);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--color-border);
}

/* ==========================================================================
   19. Tabs / Pills Navigation
   ========================================================================== */

.nav-pills-custom {
    display: flex;
    gap: 0.5rem;
    padding: 0.375rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.nav-pills-custom .nav-link {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    transition: all var(--transition-fast);
}

.nav-pills-custom .nav-link:hover {
    color: var(--color-text);
}

.nav-pills-custom .nav-link.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-xs);
}

.nav-pills-custom .nav-badge {
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

.nav-pills-custom .nav-link.active .nav-badge {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ==========================================================================
   20. Utility Classes
   ========================================================================== */

.text-muted { color: var(--color-text-muted) !important; }
.text-secondary { color: var(--color-text-secondary) !important; }
.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }

.bg-light { background: var(--color-bg-alt) !important; }
.bg-white { background: var(--color-surface) !important; }

.border { border: 1px solid var(--color-border) !important; }
.border-0 { border: none !important; }

.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* Gap utilities */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* ==========================================================================
   21. Responsive
   ========================================================================== */

@media (max-width: 991px) {
    :root {
        --content-padding: 1.5rem;
    }
}

@media (max-width: 767px) {
    /* Show mobile header, hide sidebar toggle */
    .mobile-header {
        display: flex;
    }

    .sidebar-toggle {
        display: none;
    }

    /* Sidebar becomes off-canvas on mobile */
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .sidebar-overlay {
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main content */
    .main-content {
        margin-left: 0;
        padding-top: var(--header-height);
    }

    body.has-sidebar.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: var(--content-padding-mobile);
    }

    /* Page header stack on mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    /* Auth card */
    .auth-card .card-body {
        padding: 1.5rem;
    }

    /* Stat cards */
    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    /* Tables scroll on mobile */
    .table-responsive {
        overflow-x: auto;
    }

    /* Pills wrap on mobile */
    .nav-pills-custom {
        flex-wrap: wrap;
    }

    /* Toast position */
    .toast-container {
        left: 1rem;
        right: 1rem;
        top: calc(var(--header-height) + 1rem);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 575px) {
    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    .auth-card {
        margin: 0;
    }
}

/* ==========================================================================
   22. Transitions & Animations
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
