:root {
    --bg-color: #0f172a; /* Slate 900 */
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --primary-color: #3b82f6; /* Blue 500 */
    --primary-hover: #2563eb; /* Blue 600 */
    --success-color: #10b981; /* Emerald 500 */
    --glass-bg: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.dark-theme {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Views Management */
.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active-view {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glass Card Utility */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Login View */
.login-card {
    margin-top: 15vh;
    text-align: center;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 1.1rem;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.error-msg {
    color: #ef4444; /* Red 500 */
    font-size: 0.85rem;
    margin-top: 1rem;
    min-height: 1.2rem;
}

/* Route View */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}

.driver-info h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Stats */
.route-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.stat-card.success .stat-value {
    color: var(--success-color);
}

/* Shift Tabs */
.shift-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.4rem;
    border-radius: 12px;
}

.shift-tab {
    flex: 1;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.shift-tab.active {
    background: var(--glass-bg);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.clinic-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    transition: all 0.3s;
}

.clinic-card.slide-out {
    opacity: 0;
    transform: translateX(100%);
}

.clinic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.clinic-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.clinic-items {
    list-style: none;
    margin-bottom: 1.2rem;
}

.item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.item-qty {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 0.5rem;
}

.confirm-action-btn {
    width: 100%;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-action-btn:active {
    background: rgba(16, 185, 129, 0.3);
    transform: scale(0.98);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}
