:root {
    --bg-primary: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Station Colors */
    --color-wal: #2563eb;
    --color-wal-light: rgba(37, 99, 235, 0.2);
    --color-wal-border: #3b82f6;
    
    --color-pulawska: #059669;
    --color-pulawska-light: rgba(16, 185, 129, 0.2);
    --color-pulawska-border: #10b981;

    --color-accent: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-glow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 0;
    touch-action: manipulation;
}

.app-container {
    width: 100%;
    max-width: 500px;
    padding: 16px 14px 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.logo-badge {
    font-size: 1.8rem;
    background: rgba(245, 158, 11, 0.15);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    line-height: 1;
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.15);
}

/* Legend */
.legend-bar {
    display: flex;
    justify-content: space-around;
    background: var(--bg-surface);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    font-weight: 600;
}

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

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.station-wal .dot {
    background-color: var(--color-wal-border);
    box-shadow: 0 0 10px var(--color-wal-border);
}

.station-pulawska .dot {
    background-color: var(--color-pulawska-border);
    box-shadow: 0 0 10px var(--color-pulawska-border);
}

/* Navigation */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.month-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: capitalize;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Stats Overview */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stat-card {
    background: var(--bg-surface);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-wal-card {
    border-left: 4px solid var(--color-wal-border);
}

.stat-pulawska-card {
    border-left: 4px solid var(--color-pulawska-border);
}

/* Calendar */
.calendar-wrapper {
    background: var(--bg-surface);
    padding: 14px 10px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.day-cell {
    aspect-ratio: 0.85;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 4px 3px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
}

.day-cell:active {
    transform: scale(0.94);
}

.day-cell.other-month {
    opacity: 0.25;
}

.day-cell.today {
    border-color: var(--color-accent);
}

.day-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding-left: 2px;
}

.day-cell.has-shift .day-number {
    color: #ffffff;
}

.shift-badge {
    border-radius: 4px;
    padding: 3px 2px;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    word-break: break-all;
}

/* Station Themes */
.shift-wal {
    background-color: var(--color-wal-light);
    border: 1px solid var(--color-wal-border);
    color: #60a5fa;
}

.shift-pulawska {
    background-color: var(--color-pulawska-light);
    border: 1px solid var(--color-pulawska-border);
    color: #34d399;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background: var(--bg-surface);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 20px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-group.horizontal {
    flex-direction: row;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex: 1;
}

.radio-card input[type="radio"] {
    accent-color: var(--color-accent);
}

.radio-card.station-wal-radio input[type="radio"]:checked ~ .radio-text {
    color: #60a5fa;
    font-weight: 700;
}

.radio-card.station-pulawska-radio input[type="radio"]:checked ~ .radio-text {
    color: #34d399;
    font-weight: 700;
}

.shift-info {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
}

.shift-info strong {
    font-size: 0.9rem;
}

.time-inputs {
    display: flex;
    gap: 12px;
}

.time-inputs div {
    flex: 1;
}

.time-inputs label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.time-inputs input[type="time"],
.text-input,
.file-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.hidden {
    display: none !important;
}
