:root {
    --primary: #1E1E24;
    --primary-light: #2D2D35;
    --accent: #D97706;
    --accent-light: #FEF3C7;
    --bg-page: #FAF8F5;
    --bg-card: #FFFFFF;
    --text-main: #1C1917;
    --text-muted: #78716C;
    --border-color: #E7E5E4;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 10px 30px -4px rgba(0, 0, 0, 0.08);
}

html, body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Safe areas for iPhone notch & home bar */
.app-container {
    min-height: 100vh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(env(safe-area-inset-bottom) + 70px);
}

@media (min-width: 992px) {
    .app-container {
        padding-bottom: 2rem;
    }
}

/* Modern Header / TopBar */
.topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 0.75rem 1.25rem;
}

/* Bottom Navigation Bar for iPhone / Mobile PWA */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: calc(60px + env(safe-area-inset-bottom));
    z-index: 1030;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--accent);
}

/* Sidebar for Desktop */
.desktop-sidebar {
    background-color: var(--primary);
    color: #FAF8F5;
    min-height: 100vh;
    padding: 1.5rem 1rem;
}

.sidebar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #FFFFFF;
    margin-bottom: 2rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #A8A29E;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

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

.sidebar-link.active i {
    color: var(--accent);
}

/* Cards & UI elements */
.card-romianika,
.card-romanika {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-romianika:hover,
.card-romanika:hover {
    box-shadow: var(--shadow-float);
}

.metric-card {
    border-left: 4px solid var(--accent);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
    line-height: 1.2;
}

.metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Badges */
.badge-romianika,
.badge-romanika {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    display: inline-block;
}

.badge-ordered { background-color: #DBEAFE; color: #1E40AF; }
.badge-transit { background-color: #FEF3C7; color: #92400E; }
.badge-customs { background-color: #E0E7FF; color: #3730A3; }
.badge-warehouse { background-color: #D1FAE5; color: #065F46; }
.badge-delivered { background-color: #DCFCE7; color: #15803D; }
.badge-danger { background-color: #FEE2E2; color: #991B1B; }
.badge-neutral { background-color: #F5F5F4; color: #57534E; }

/* Buttons */
.btn-primary-romianika,
.btn-primary-romanika {
    background-color: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-primary-romianika:hover,
.btn-primary-romanika:hover {
    background-color: #33333D;
    color: #FFFFFF;
}

.btn-accent-romianika,
.btn-accent-romanika {
    background-color: var(--accent);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-accent-romianika:hover,
.btn-accent-romanika:hover {
    background-color: #B45309;
    color: #FFFFFF;
}

/* Customer Tracking Public Timeline */
.timeline-stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 2rem 0;
}

.timeline-stepper::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    height: 3px;
    background-color: var(--border-color);
    z-index: 1;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    text-align: center;
    width: 20%;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #FFFFFF;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.step-item.completed .step-circle {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
}

.step-item.current .step-circle {
    background-color: #FFFFFF;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step-item.current .step-label {
    color: var(--text-main);
    font-weight: 700;
}

/* Blazor Error Notification Bar */
#blazor-error-ui {
    background: #FFFBEB;
    color: #92400E;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    font-size: 0.88rem;
    font-weight: 500;
    border-top: 1px solid #FCD34D;
}

#blazor-error-ui .reload {
    color: #B45309;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1.25rem;
    top: 0.75rem;
    font-size: 1.1rem;
    color: #92400E;
}

/* App Footer */
.app-footer {
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    padding-bottom: calc(env(safe-area-inset-bottom) + 65px);
}

@media (min-width: 992px) {
    .app-footer {
        padding-bottom: 1rem;
    }
}