/* Driver App - Enterprise Professional Theme v2 */
/* Clean, Clear, Status-Driven Design */

/* Global SVG icon sizing */
svg {
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

:root {
    /* ========================================
       ENTERPRISE COLOR SYSTEM
       Professional base + Clear semantic colors
       ======================================== */

    /* Primary - AG Digital Blue */
    --primary: #225588;
    --primary-light: #2d6ba6;
    --primary-dark: #1a4470;

    /* Secondary - Cool Steel */
    --secondary: #64748B;
    --secondary-light: #94A3B8;

    /* ========================================
       SEMANTIC COLORS - High Clarity
       These should be INSTANTLY recognizable
       ======================================== */

    /* Success - Vibrant Green (Clear positive signal) */
    --success: #059669;
    --success-light: #10B981;
    --success-bg: #ECFDF5;
    --success-border: #A7F3D0;

    /* Warning/Orange - Warm amber (Continue, In Transit) */
    --warning: #EA580C;
    --warning-light: #F97316;
    --warning-bg: #FFF7ED;
    --warning-border: #FED7AA;

    /* Danger - Clear Red (Unmistakable alert) */
    --danger: #DC2626;
    --danger-light: #EF4444;
    --danger-bg: #FEF2F2;
    --danger-border: #FECACA;

    /* Info - Header Blue (Matches app header #225588) */
    --info: #225588;
    --info-light: #3b82f6;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    /* Pending/Neutral - Gray */
    --pending: #6B7280;
    --pending-light: #9CA3AF;
    --pending-bg: #F3F4F6;
    --pending-border: #E5E7EB;

    /* ========================================
       BACKGROUND & SURFACE COLORS
       ======================================== */

    --bg-gradient: linear-gradient(145deg, #F3F4F6 0%, #E5E7EB 50%, #D1D5DB 100%);
    --bg-solid: #F3F4F6;
    --surface: #F1F5F9;
    --surface-elevated: #F1F5F9;

    /* Glass Effect */
    --glass-bg: rgba(241, 245, 249, 0.92);
    --glass-bg-hover: rgba(241, 245, 249, 0.98);
    --glass-border: rgba(34, 85, 136, 0.12);
    --glass-shadow: 0 4px 24px rgba(34, 85, 136, 0.08), 0 2px 8px rgba(34, 85, 136, 0.04);
    --glass-shadow-hover: 0 8px 32px rgba(34, 85, 136, 0.12), 0 4px 12px rgba(34, 85, 136, 0.06);
    --glass-blur: blur(12px);

    /* Text Colors */
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Borders */
    --border-light: #E2E8F0;
    --border-medium: #CBD5E1;
    --border-strong: #94A3B8;

    /* Radius - Professional, crisp */
    --radius: 10px;
    --radius-sm: 6px;
    --radius-xs: 4px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* ============================================
   HEADER - Professional Navy
   ============================================ */

.app-header {
    background: var(--primary);
    color: var(--text-inverse);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(74, 85, 104, 0.2);
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.3px;
}

.app-header .subtitle {
    font-size: 13px;
    opacity: 0.85;
    text-align: center;
    margin-top: 2px;
    font-weight: 400;
}

.header-with-back {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.header-title {
    flex: 1;
}

.header-title h1 {
    text-align: left;
    font-size: 17px;
}

.header-title .subtitle {
    text-align: left;
    font-size: 12px;
}

/* Dashboard Header */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.driver-avatar {
    width: 42px;
    height: 42px;
    background: #F1F5F9;
    border: 2px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.driver-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.driver-name {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.driver-vehicle {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
}

.settings-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.15s ease;
}

.settings-btn:hover, .settings-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.settings-btn svg {
    width: 20px;
    height: 20px;
}

.header-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    gap: 10px;
    flex-wrap: wrap;
}

/* Status Pill - Clear active/inactive */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-pill.status-active {
    background: var(--success);
    color: white;
}

.status-pill.status-inactive {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* Mobile header */
@media (max-width: 360px) {
    .driver-avatar { width: 38px; height: 38px; font-size: 13px; }
    .driver-name { font-size: 14px; }
    .settings-btn, .back-btn { width: 36px; height: 36px; }
    .status-pill { padding: 4px 10px; font-size: 10px; }
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.app-content {
    padding: 16px 16px 100px;
}

.section-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 24px 0 12px;
    padding-left: 2px;
}


/* ============================================
   CARDS - Clean elevated surfaces
   ============================================ */

.shipment-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    margin-bottom: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}

.shipment-card:active {
    transform: scale(0.98);
}

.shipment-card:hover {
    background: var(--glass-bg-hover);
    box-shadow: var(--glass-shadow-hover);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.shipment-card-header {
    padding: 16px 16px 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.shipment-id {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 3px;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.shipment-route {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.route-arrow {
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.shipment-card-body {
    padding: 4px 16px 16px;
}

.shipment-card-body.with-divider {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.shipment-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   STATUS BADGES - HIGH CLARITY
   Instantly recognizable status indicators
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Draft - Gray, neutral */
.status-draft {
    background: var(--pending-bg);
    color: var(--pending);
    border: 1px solid var(--pending-border);
}

/* Planned - Gray (waiting state) */
.status-planned {
    background: var(--pending-bg);
    color: var(--pending);
    border: 1px solid var(--pending-border);
}

/* In Transit - Blue, active */
.status-in-transit {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

/* Completed - Green, positive confirmation */
.status-completed {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

/* Overdue - Red, urgent alert - SOLID for visibility */
.status-overdue {
    background: var(--danger);
    color: white;
    border: 1px solid var(--danger);
}

/* Overdue shipment cards - enhanced visibility */
.shipment-card-overdue,
.shipment-card[style*="border-color: #fecaca"] {
    border: 2px solid var(--danger) !important;
    background: linear-gradient(to bottom, #FEF2F2, var(--surface));
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15), var(--glass-shadow);
}

.shipment-card-overdue:hover,
.shipment-card[style*="border-color: #fecaca"]:hover {
    border-color: var(--danger-light) !important;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.2), var(--glass-shadow-hover);
}

/* Ongoing/In Transit shipment cards - header blue styling for visibility */
.shipment-card-ongoing,
.shipment-card[style*="border-color: #bfdbfe"] {
    border: 2px solid var(--info) !important;
    background: linear-gradient(to bottom, var(--info-bg), var(--surface));
    box-shadow: 0 4px 12px rgba(34, 85, 136, 0.15), var(--glass-shadow);
}

.shipment-card-ongoing:hover,
.shipment-card[style*="border-color: #bfdbfe"]:hover {
    border-color: var(--info-light) !important;
    box-shadow: 0 6px 16px rgba(34, 85, 136, 0.2), var(--glass-shadow-hover);
}

/* Cancelled/Failed - Red, clear alert */
.status-cancelled,
.status-failed {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* Ongoing - Blue, active (same as In Transit) */
.status-ongoing {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

/* ============================================
   BUTTONS - Clear action hierarchy
   ============================================ */

.shipment-card-action {
    padding: 4px 16px 16px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 48px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    background: var(--success-light);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Explicit Start Trip button styling */
.btn-start,
.btn[class*="start"] {
    background: var(--success) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.btn-start:hover,
.btn[class*="start"]:hover {
    background: var(--success-light) !important;
}

.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
    background: var(--warning-light);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* Continue button - header blue */
.btn-continue,
.btn[class*="continue"] {
    background: var(--info) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(34, 85, 136, 0.3);
}

.btn-continue:hover,
.btn[class*="continue"]:hover {
    background: var(--info-light) !important;
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: var(--danger-light);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-outline {
    background: var(--glass-bg);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-danger-outline {
    background: var(--glass-bg);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 15px;
    min-height: 54px;
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-lg .btn-icon {
    width: 20px;
    height: 20px;
}

.btn-icon.spin {
    animation: spin 1s linear infinite;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-light);
    color: var(--text-primary);
}

/* ============================================
   INFO CARDS
   ============================================ */

.info-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--glass-shadow);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

/* ============================================
   OPERATIONS - Clear status progression
   ============================================ */

.operations-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin-bottom: 12px;
}

.operation-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.operation-row:last-child {
    border-bottom: none;
}

/* Completed - Muted, done */
.operation-row.completed {
    background: var(--success-bg);
}

/* Pending - Waiting */
.operation-row.pending {
    opacity: 0.7;
}

/* Current - Active highlight */
.operation-row.current {
    background: var(--info-bg);
    border-left: 4px solid var(--info);
    padding-left: 12px;
}

.operation-row.current:active {
    background: #E0F2FE;
}

/* Operation Number Badge */
.operation-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--pending-bg);
    color: var(--pending);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-right: 12px;
    border: 2px solid var(--pending-border);
}

.operation-number.completed {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.operation-number.current {
    background: var(--info);
    color: white;
    border-color: var(--info);
    box-shadow: 0 0 0 3px var(--info-bg);
}

.operation-number.skipped {
    background: var(--pending-bg);
    color: var(--pending);
    text-decoration: line-through;
}

.operation-details {
    flex: 1;
    min-width: 0;
}

.operation-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.operation-details p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.operation-status {
    font-size: 18px;
    margin-left: 12px;
    flex-shrink: 0;
}

/* Legacy card-based operations */
.operation-item {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    margin-bottom: 10px;
    overflow: hidden;
    display: flex;
    border: 1px solid var(--border-light);
}

.operation-sequence {
    background: var(--pending-bg);
    color: var(--pending);
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.operation-sequence.completed {
    background: var(--success);
    color: white;
}

.operation-sequence.current {
    background: var(--info);
    color: white;
}

.operation-sequence.skipped {
    background: var(--pending-bg);
    color: var(--pending);
}

.operation-content {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.operation-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.operation-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Status Icons - Clear colors */
.status-icon {
    width: 22px;
    height: 22px;
}

.status-icon.status-completed {
    color: var(--success);
}

.status-icon.status-current {
    color: var(--info);
}

.status-icon.status-pending {
    color: var(--pending);
}

/* ============================================
   VEHICLE SECTION
   ============================================ */

.vehicle-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--glass-shadow);
}

.vehicle-plate {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.vehicle-model {
    font-size: 13px;
    color: var(--text-muted);
}

.vehicle-condition {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    flex-wrap: wrap;
}

.vehicle-condition .condition-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vehicle-condition .condition-label {
    font-weight: 500;
    color: var(--text-muted);
}

.vehicle-condition .condition-value {
    font-weight: 700;
}

.vehicle-condition .condition-value.yes {
    color: var(--success);
}

.vehicle-condition .condition-value.no {
    color: var(--danger);
}

/* Vehicle to Load */
.vehicle-to-load {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--glass-shadow);
}

.vehicle-to-load-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vehicle-to-load-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.vehicle-to-load-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vehicle-to-load-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-solid);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.vehicle-to-load-item .vehicle-icon {
    font-size: 22px;
    margin-right: 12px;
    flex-shrink: 0;
}

.vehicle-to-load-item .vehicle-info {
    flex: 1;
    min-width: 0;
}

.vehicle-to-load-item .vehicle-info .plate {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.vehicle-to-load-item .vehicle-info .model {
    font-size: 12px;
    color: var(--text-muted);
}

.vehicle-to-load-item .vehicle-status {
    font-size: 18px;
    margin-left: 12px;
}

/* ============================================
   LOCATION CARD
   ============================================ */

.location-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--glass-shadow);
}

.location-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.location-header .location-icon {
    font-size: 22px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.location-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.location-address {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.location-contact {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.contact-link:hover {
    text-decoration: underline;
}

/* ============================================
   PHOTO SECTION
   ============================================ */

.photo-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--glass-shadow);
}

.photo-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.photo-slot {
    aspect-ratio: 4/3;
    background: var(--bg-solid);
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.photo-slot:hover {
    border-color: var(--primary);
    background: var(--info-bg);
}

.photo-slot-icon {
    font-size: 28px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.photo-slot-text {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.photo-slot.has-photo {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-bg);
}

.photo-slot.has-photo .photo-slot-icon {
    color: var(--success);
}

/* ============================================
   FIXED ACTIONS
   ============================================ */

.action-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 16px rgba(74, 85, 104, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-light);
}

.action-buttons-row {
    display: flex;
    gap: 8px;
}

.action-buttons-row .btn {
    flex: 1;
}

/* ============================================
   ORDERS & VEHICLES
   ============================================ */

.order-item {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.order-customer {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.order-customer-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.order-dates {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.order-date-item {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.order-date-label {
    font-weight: 500;
    color: var(--text-muted);
}

.order-details-section {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
}

.order-details-section .condition-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-details-section .condition-label {
    font-weight: 500;
    color: var(--text-muted);
}

.order-details-section .condition-value {
    color: var(--text-primary);
}

.order-vehicles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vehicle-tag {
    background: var(--info-bg);
    color: var(--info);
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--info-border);
}

/* ============================================
   NOTES INPUT
   ============================================ */

.notes-input {
    width: 100%;
    padding: 14px;
    background: var(--bg-solid);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: all 0.15s ease;
    color: var(--text-primary);
}

.notes-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #F1F5F9;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
}

.notes-input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   MAP PLACEHOLDER
   ============================================ */

.map-placeholder {
    background: var(--bg-solid);
    height: 100px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-top: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-medium);
    transition: all 0.15s ease;
}

.map-placeholder:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   TOASTS - Clear status communication
   ============================================ */

.toast {
    position: fixed;
    bottom: 90px;
    left: 16px;
    right: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideUp 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.toast-success {
    background: var(--success);
    color: white;
}

.toast.toast-warning {
    background: var(--warning);
    color: white;
}

.toast.toast-danger {
    background: var(--danger);
    color: white;
}

.toast.toast-info {
    background: var(--info);
    color: white;
}

@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(16px); opacity: 0; }
}

/* Persistent realtime toast */
.toast-realtime {
    display: flex;
    align-items: stretch;
    padding: 0;
    gap: 0;
}

.toast-realtime-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 14px 16px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.toast-realtime-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-realtime-text {
    font-size: 13px;
    line-height: 1.4;
    min-width: 0;
}

.toast-realtime-text strong {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.toast-realtime-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    padding: 0 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 48px;
    -webkit-tap-highlight-color: transparent;
}

.toast-realtime-close:active {
    background: rgba(255, 255, 255, 0.35);
}

/* ============================================
   LOADING STATES
   ============================================ */

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, #F1F5F9 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.btn:focus-visible,
.shipment-card:focus-visible,
.back-btn:focus-visible,
.settings-btn:focus-visible,
.photo-slot:focus-visible,
.operation-row:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --glass-bg: #FFFFFF;
        --glass-border: #000000;
        --text-primary: #000000;
        --text-secondary: #1a1a1a;
        --border-light: #666666;
    }
}

/* ============================================
   YMS COMPATIBILITY LAYER
   Mapping yms-* classes to driver theme styles
   ============================================ */

/* App Container */
.yms-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.yms-header {
    background: var(--primary);
    color: var(--text-inverse);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(34, 85, 136, 0.3), 0 4px 24px rgba(30, 58, 138, 0.15);
    overflow: hidden;
}


.yms-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.yms-back-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.yms-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-2px);
}

.yms-header-content {
    flex: 1;
    min-width: 0;
}

.yms-header-title {
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.yms-header-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin: 4px 0 0;
    font-weight: 500;
}

/* Main Content */
.yms-main {
    flex: 1;
    padding: 20px 16px 100px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.yms-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    transition: all 0.2s ease;
}

.yms-card:hover {
    box-shadow: var(--glass-shadow-hover);
    transform: translateY(-2px);
}

.yms-card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.5);
}

.yms-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.yms-card-description {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.yms-card-body {
    padding: 16px;
}

.yms-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
}

/* Alerts */
.yms-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 16px;
}

.yms-alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yms-alert-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.yms-alert-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}

.yms-alert-close:hover {
    opacity: 1;
}

.yms-alert-info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info);
}

.yms-alert-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.yms-alert-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.yms-alert-error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
}

/* Sections */
.yms-section {
    margin-bottom: 32px;
}

.yms-section:first-child {
    margin-top: 0;
}

.yms-section-header {
    margin-bottom: 16px;
}

.yms-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.yms-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--info), var(--info-light));
    flex-shrink: 0;
}

/* Dashboard Grid */
.yms-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .yms-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .yms-dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.yms-dashboard-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-top: 3px solid var(--info);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--glass-shadow);
}

.yms-dashboard-card:has(.yms-dashboard-card-icon.success) {
    border-top-color: var(--success);
}

.yms-dashboard-card:has(.yms-dashboard-card-icon.warning) {
    border-top-color: var(--warning);
}

.yms-dashboard-card:has(.yms-dashboard-card-icon.primary) {
    border-top-color: #764ba2;
}

.yms-dashboard-card:hover {
    box-shadow: 0 8px 32px rgba(34, 85, 136, 0.15);
    transform: translateY(-4px) scale(1.01);
}

.yms-dashboard-card:has(.yms-dashboard-card-icon.success):hover {
    box-shadow: 0 8px 32px rgba(5, 150, 105, 0.18);
}

.yms-dashboard-card:has(.yms-dashboard-card-icon.warning):hover {
    box-shadow: 0 8px 32px rgba(234, 88, 12, 0.18);
}

.yms-dashboard-card:has(.yms-dashboard-card-icon.primary):hover {
    box-shadow: 0 8px 32px rgba(118, 75, 162, 0.18);
}

.yms-dashboard-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--info-bg), rgba(59, 130, 246, 0.15));
    color: var(--info);
}

.yms-dashboard-card-icon.success {
    background: linear-gradient(135deg, var(--success-bg), rgba(5, 150, 105, 0.15));
    color: var(--success);
}

.yms-dashboard-card-icon.warning {
    background: linear-gradient(135deg, var(--warning-bg), rgba(234, 88, 12, 0.15));
    color: var(--warning);
}

.yms-dashboard-card-icon.primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.15));
    color: #764ba2;
}

.yms-dashboard-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.yms-dashboard-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.yms-dashboard-card-arrow {
    margin-left: auto;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.yms-dashboard-card:hover .yms-dashboard-card-arrow {
    transform: translateX(6px);
    color: var(--info);
}

/* Form Elements */
.yms-form-group {
    margin-bottom: 16px;
}

.yms-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.yms-select,
.yms-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-primary);
    background: white;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.yms-select:focus,
.yms-input:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(34, 85, 136, 0.1);
}

.yms-input-lg {
    padding: 12px 14px;
    font-size: 15px;
}

/* Utilities */
.yms-mb-6 {
    margin-bottom: 24px;
}

.yms-text-muted {
    color: var(--text-muted);
}

/* Toast Notifications */
.yms-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-16px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading */
.yms-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.yms-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--info);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tank Level Indicator */
.yms-tank {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yms-tank-bar {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.yms-tank-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

.yms-tank-fill.medium {
    background: var(--warning);
}

.yms-tank-fill.low {
    background: var(--danger);
}

.yms-tank-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .yms-header-title {
        font-size: 20px;
    }

    .yms-main {
        padding: 16px 12px 100px;
    }
}

/* ============================================
   ADDITIONAL YMS COMPONENTS
   Buttons, Tables, Filters, etc.
   ============================================ */

/* Buttons */
.yms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.yms-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.yms-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.yms-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.3);
}

.yms-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 85, 104, 0.4);
}

.yms-btn-secondary {
    background: var(--glass-bg);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.yms-btn-secondary:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.yms-btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.yms-btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

.yms-btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.yms-btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.yms-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.yms-btn-lg {
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius);
}

.yms-btn-block {
    width: 100%;
}

.yms-btn-icon {
    padding: 12px;
    aspect-ratio: 1;
}

/* Tables */
.yms-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

.yms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.yms-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.yms-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-primary);
}

.yms-table tbody tr {
    transition: all 0.15s ease;
}

.yms-table tbody tr:hover {
    background: linear-gradient(90deg, var(--surface) 0%, transparent 100%);
}

.yms-table tbody tr:last-child td {
    border-bottom: none;
}

.yms-table-link {
    color: var(--info);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    background: var(--info-bg);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    display: inline-block;
}

.yms-table-link:hover {
    color: white;
    background: var(--info);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Filters - Single row on desktop */
.yms-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: flex-end;
    overflow-x: auto;
}

.yms-filters .yms-form-group {
    flex: 1 1 auto;
    min-width: 150px;
    max-width: 250px;
    margin-bottom: 0;
}

.yms-filters-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.yms-filters .yms-btn,
.yms-filters-actions .yms-btn {
    height: 46px;
    flex-shrink: 0;
}

/* Action Bar */
.yms-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    padding: 16px;
    z-index: 100;
    box-shadow: 0 -2px 16px rgba(74, 85, 104, 0.08);
}

.yms-action-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

.yms-action-bar-inner .yms-btn {
    flex: 1;
}

/* Empty States */
.yms-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.yms-empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.yms-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.yms-empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto 24px;
}

/* Section Count */
.yms-section-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 4px 12px;
    background: var(--surface);
    border-radius: var(--radius-full);
}

/* Utility Classes */
.yms-font-mono {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.yms-hide-mobile {
    display: table-cell;
}

@media (max-width: 640px) {
    .yms-hide-mobile {
        display: none;
    }

    .yms-filters {
        flex-direction: column;
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .yms-filters .yms-form-group {
        width: 100%;
        max-width: none;
    }

    .yms-filters-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .yms-filters-actions .yms-btn {
        flex: 1;
    }
}

/* ============================================
   FORM COMPONENTS (Extended)
   ============================================ */

/* Form rows */
.yms-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.yms-form-row {
    display: grid;
    gap: 16px;
}

.yms-form-row.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.yms-form-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Required label indicator */
.yms-label-required::after {
    content: "*";
    color: var(--danger);
    margin-left: 4px;
}

/* Textarea */
.yms-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-primary);
    background: white;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.yms-textarea:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(34, 85, 136, 0.1);
}

/* Upload areas */
.yms-upload {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
}

.yms-upload:hover {
    border-color: var(--info);
    background: var(--info-bg);
}

.yms-upload input[type="file"] {
    display: none;
}

.yms-upload-icon {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.yms-upload-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.yms-upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Photo grid */
.yms-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.yms-photo-empty {
    aspect-ratio: 4/3;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
}

.yms-photo-empty-icon {
    font-size: 24px;
}

.yms-photo-empty-text {
    font-size: 13px;
    font-weight: 500;
}

/* Document list */
.yms-doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yms-doc-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}

.yms-doc-info {
    flex: 1;
    min-width: 0;
}

.yms-doc-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yms-doc-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Autocomplete */
.yms-autocomplete {
    position: relative;
}

.yms-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.yms-autocomplete-dropdown.show {
    display: block;
    animation: dropdown-in 150ms ease-out;
}

@keyframes dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.yms-autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s ease;
}

.yms-autocomplete-item:last-child {
    border-bottom: none;
}

.yms-autocomplete-item:hover,
.yms-autocomplete-item.active {
    background: var(--surface);
}

/* Z-index layers */
:root {
    --z-dropdown: 1000;
    --z-fixed: 1000;
    --z-modal: 1100;
    --z-toast: 1200;
}

/* Spacing utilities */
.yms-mb-4 {
    margin-bottom: 16px;
}

/* CSS Variables that entrada page needs */
:root {
    --yms-space-1: 4px;
    --yms-space-2: 8px;
    --yms-space-3: 12px;
    --yms-space-4: 16px;
    --yms-space-5: 20px;
    --yms-space-6: 24px;
    --yms-space-8: 32px;
    --yms-space-12: 48px;
    
    --yms-radius-sm: 6px;
    --yms-radius-md: 8px;
    --yms-radius-lg: 10px;
    --yms-radius-xl: 12px;
    --yms-radius-full: 9999px;
    
    --yms-border-default: var(--border-medium);
    --yms-border-light: var(--border-light);
    
    --yms-bg-primary: white;
    --yms-bg-secondary: var(--surface);
    
    --yms-text-primary: var(--text-primary);
    --yms-text-secondary: var(--text-secondary);
    --yms-text-muted: var(--text-muted);
    
    --yms-primary-50: #f8fafc;
    --yms-primary-100: #e2e8f0;
    --yms-primary-200: #cbd5e1;
    --yms-primary-300: #94a3b8;
    --yms-primary-400: #64748b;
    --yms-primary-500: var(--primary);
    --yms-primary-600: var(--primary-dark);
    
    --yms-gray-50: #f9fafb;
    --yms-gray-100: #f3f4f6;
    --yms-gray-200: #e5e7eb;
    --yms-gray-600: #4b5563;
    --yms-gray-700: #374151;
    
    --yms-danger-100: var(--danger-bg);
    --yms-danger-600: var(--danger);
    
    --yms-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --yms-font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --yms-font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --yms-transition-fast: 150ms ease;
    --yms-transition-normal: 200ms ease;
    --yms-transition-slow: 300ms ease;
    
    --yms-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --yms-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --yms-gradient-cool: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --yms-gradient-success: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    --yms-gradient-warning: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    --yms-gradient-danger: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    --yms-gradient-warm: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    
    --yms-z-dropdown: 1000;
    --yms-z-fixed: 1000;
    --yms-z-modal: 1100;
    --yms-z-sticky: 100;
}

/* Filters button alignment - consolidated above */

@media (max-width: 768px) {
    .yms-form-row.cols-2,
    .yms-form-row.cols-3 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MISSING UTILITY CLASSES & COMPONENTS
   ============================================ */

/* Badges */
.yms-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--surface);
    color: var(--text-secondary);
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.yms-badge.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 85, 104, 0.3);
}

.yms-badge.success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.yms-badge.warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

.yms-badge.danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.yms-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Additional button variants */
.yms-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.yms-btn-ghost:hover:not(:disabled) {
    background: var(--surface);
    color: var(--primary);
}

.yms-btn-xl {
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 700;
    border-radius: var(--radius);
}

/* Interactive card */
.yms-card-interactive {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.yms-card-interactive:hover {
    transform: translateY(-4px);
}

/* Alert title */
.yms-alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

/* Autocomplete empty state */
.yms-autocomplete-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Table empty state */
.yms-table-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.yms-table-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.yms-table-empty-text {
    font-size: 14px;
}

/* Info list (for detail pages) */
.yms-info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.yms-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.yms-info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.yms-info-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* Stats grid */
.yms-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.yms-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.yms-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.yms-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.yms-stat-change {
    font-size: 13px;
    font-weight: 500;
}

.yms-stat-change.positive {
    color: var(--success);
}

.yms-stat-change.negative {
    color: var(--danger);
}

/* Photo/document items */
.yms-photo-item {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.yms-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yms-doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.yms-doc-action {
    margin-left: auto;
    flex-shrink: 0;
}

/* Skeleton loader */
.yms-skeleton {
    background: linear-gradient(90deg, var(--surface) 0%, #e2e8f0 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Text utilities */
.yms-text-center {
    text-align: center;
}

.yms-text-right {
    text-align: right;
}

.yms-text-success {
    color: var(--success);
}

.yms-text-warning {
    color: var(--warning);
}

.yms-text-danger {
    color: var(--danger);
}

/* Font weight utilities */
.yms-font-bold {
    font-weight: 700;
}

.yms-font-semibold {
    font-weight: 600;
}

/* Spacing utilities */
.yms-mb-0 { margin-bottom: 0; }
.yms-mb-2 { margin-bottom: 8px; }
.yms-mb-4 { margin-bottom: 16px; }

.yms-mt-0 { margin-top: 0; }
.yms-mt-2 { margin-top: 8px; }
.yms-mt-4 { margin-top: 16px; }
.yms-mt-6 { margin-top: 24px; }

/* Form helpers */
.yms-form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.yms-form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* Screen reader only */
.yms-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
