/* Sofőrnapló - Modern Clean UI */

:root {
    /* Light mode - Clean, professional */
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --accent: #3182ce;
    --accent-hover: #2c5aa0;
    --accent-light: rgba(49, 130, 206, 0.1);
    --success: #38a169;
    --success-light: rgba(56, 161, 105, 0.1);
    --error: #e53e3e;
    --error-light: rgba(229, 62, 62, 0.1);
    --warning: #d69e2e;
    --warning-light: rgba(214, 158, 46, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --input-bg: #ffffff;
    --input-border: #cbd5e0;
    --fuel: #7c5cbf;
    --fuel-light: rgba(124, 92, 191, 0.1);
}

[data-theme="dark"] {
    /* Finomhangolt szemkímélő sötét mód */
    --bg-primary: #151a22;
    --bg-secondary: #1c2333;
    --bg-card: #1c2333;
    --border-color: #2f3a4e;
    --text-primary: #c8d0dc;
    --text-secondary: #9aa6b8;
    --text-muted: #7a8698;
    --accent: #5a98c8;
    --accent-hover: #4a88b8;
    --accent-light: rgba(90, 152, 200, 0.14);
    --success: #52b07a;
    --success-light: rgba(82, 176, 122, 0.16);
    --error: #d48080;
    --error-light: rgba(212, 128, 128, 0.16);
    --warning: #ccaa44;
    --warning-light: rgba(204, 170, 68, 0.16);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
    --input-bg: #1c2333;
    --input-border: #384558;
    --fuel: #a084d8;
    --fuel-light: rgba(160, 132, 216, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
}

body > main {
    flex: 1;
}

/* Container */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 1.5rem;
    }
}

/* Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .glass-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
}

.glass-card:hover {
    box-shadow: var(--shadow-md);
}

/* Navigation */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.navbar-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    /* Reset for <button> elements */
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

/* Logout button */
.nav-link.nav-logout,
.mobile-nav-link.nav-logout {
    color: var(--error);
}

.nav-link.nav-logout:hover,
.mobile-nav-link.nav-logout:hover {
    color: var(--error);
    background: var(--error-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}


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

/* Shift buttons — gradient style */
.btn-shift-start {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.3);
    transition: all 0.2s ease;
}

.btn-shift-start:hover {
    box-shadow: 0 4px 16px rgba(49, 130, 206, 0.4);
    transform: translateY(-1px);
}

.btn-shift-start:active {
    transform: translateY(0) scale(0.98);
}

.btn-shift-stop {
    background: linear-gradient(135deg, #c05050 0%, #943838 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(192, 80, 80, 0.3);
    transition: all 0.2s ease;
}

.btn-shift-stop:hover {
    box-shadow: 0 4px 16px rgba(192, 80, 80, 0.4);
    transform: translateY(-1px);
}

.btn-shift-stop:active {
    transform: translateY(0) scale(0.98);
}

.btn-shift-start:disabled,
.btn-shift-stop:disabled {
    transform: none;
    box-shadow: none;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
}

.form-label-opt {
    font-size: 0.75em;
    font-weight: 400;
    color: var(--text-muted);
}

.form-label-req {
    color: var(--error);
    margin-left: 1px;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Fix autofill background in dark mode */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-control.is-invalid {
    border-color: var(--error);
}

/* Suppress browser default :invalid styling (yellow/gold borders on required empty fields) */
.form-control:invalid,
input.form-control:invalid,
select.form-control:invalid,
textarea.form-control:invalid {
    border-color: var(--input-border) !important;
    box-shadow: none !important;
    outline: none !important;
}

.form-control:invalid:focus,
input.form-control:invalid:focus,
select.form-control:invalid:focus,
textarea.form-control:invalid:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light) !important;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--error);
    margin-top: 0.25rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-control {
    flex: 1;
    min-width: 0;
}

.input-group .btn {
    flex-shrink: 0;
}

/* Select styling */
select.form-control {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

/* Dark mode select arrow */
[data-theme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23a0aec0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-cols-2 {
    grid-template-columns: 1fr;
}

.grid-cols-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Stats Cards */
.stat-card {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.2;
    word-wrap: break-word;
    hyphens: auto;
}

@media (min-width: 640px) {
    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8125rem;
    }
}

/* B3 Weekly Summary Mini Card */
.b3-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 0.55rem 0.85rem;
}

.b3-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.b3-top-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.week-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    display: inline-block;
}

.b3-rows {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.b3-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.b3-icon {
    font-size: 0.75rem;
    flex-shrink: 0;
    width: 1.1rem;
    text-align: center;
}

.b3-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex: 1;
}

.b3-value {
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.b3-row:nth-child(1) .b3-value { color: var(--success); }
.b3-row:nth-child(2) .b3-value { color: var(--accent); }
.b3-row:nth-child(3) .b3-value { color: var(--warning); }

.b3-fuel-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--fuel-light);
    color: var(--fuel);
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
    font-variant-numeric: tabular-nums;
}

/* Chart stat colors for charts page */
.stat-km-color {
    color: #10b981 !important;
}
.stat-days-color {
    color: #f59e0b !important;
}
.stat-fuel-color {
    color: var(--fuel) !important;
}

/* Fuel chart legend & info */
.chart-fuel-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.chart-fuel-legend span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.chart-fuel-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.chart-fuel-info {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-style: italic;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-locked {
    background: var(--success-light);
    color: var(--success);
}

.badge-admin {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-active {
    background: var(--success-light);
    color: var(--success);
}

.badge-disabled {
    background: var(--error-light);
    color: var(--error);
}

/* Alert */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid var(--error);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.alert-info {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
}

/* Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -0.5rem;
    padding: 0.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: var(--bg-primary);
}

/* Section */
.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Spacing utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

/* Flex utilities */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Login page */
.login-container {
    min-height: calc(100vh - 5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-primary);
}

.login-card {
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.login-input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
}

.login-input-wrapper {
    position: relative;
}

.login-input-wrapper .form-control {
    padding-left: 2.5rem;
}

.login-about-link {
    text-align: center;
    margin-top: 1rem;
}

.login-about-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    border-bottom: 1px dashed var(--text-muted);
    transition: color 0.2s, border-color 0.2s;
}

.login-about-link a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.login-join-card {
    max-width: 400px;
    width: 100%;
    margin: 1rem auto 0;
    padding: 1.25rem 1.5rem;
    text-align: center;
}

.login-join-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    user-select: none;
}

.login-join-icon {
    font-size: 1.25rem;
}

.login-join-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.login-join-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.login-join-card.open .login-join-chevron {
    transform: rotate(180deg);
}

.login-join-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
    line-height: 1.5;
}

.login-join-form {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.login-join-card.open .login-join-form {
    max-height: 500px;
    opacity: 1;
}

.login-join-form-inner {
    padding-top: 1rem;
    text-align: left;
}

.login-join-form .form-group {
    margin-bottom: 0.75rem;
}

.login-join-form .form-label {
    font-size: 0.8125rem;
}

.login-join-form .form-control {
    font-size: 0.875rem;
}

.login-join-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.login-join-submit {
    width: 100%;
    margin-top: 0.25rem;
}

.login-join-limit {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 0.25rem;
}

/* Remember me */
.remember-me {
    margin-bottom: 1rem;
}

.remember-me label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.remember-me input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Theme toggle */
.theme-toggle {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.125rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Theme toggle with text for public navbar (about, changelog) */
.theme-toggle.theme-toggle-nav {
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-family: inherit;
}

.theme-toggle-nav .theme-icon {
    font-size: 1.1rem;
}

/* Fixed theme toggle for standalone pages (login, forgot password, etc.) */
.theme-toggle-fixed {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    user-select: none;
    z-index: 100;
    font-family: inherit;
}

.theme-toggle-fixed:hover {
    background: var(--border-color);
}

.theme-toggle-fixed .theme-icon {
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--border-color);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    z-index: 9999;
    pointer-events: none;
}

@media (max-width: 480px) {
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 1rem;
    }
}

.toast {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastIn 0.3s ease-out;
    border-left: 5px solid;
}

@media (max-width: 480px) {
    .toast {
        min-width: unset;
        max-width: unset;
    }
}

.toast.toast-hiding {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.6;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success {
    background: #e6f4ed;
    border-left-color: var(--success);
    color: var(--success);
}

.toast-error {
    background: #fbe8e8;
    border-left-color: var(--error);
    color: var(--error);
}

.toast-warning {
    background: #fbf3e0;
    border-left-color: var(--warning);
    color: var(--warning);
}

.toast-info {
    background: #e5eff8;
    border-left-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .toast-success { background: #283f34; }
[data-theme="dark"] .toast-error { background: #402a32; }
[data-theme="dark"] .toast-warning { background: #3e3828; }
[data-theme="dark"] .toast-info { background: #283444; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: toastProgress 4s linear forwards;
}

.toast-success .toast-progress { background: var(--success); }
.toast-error .toast-progress { background: var(--error); }
.toast-warning .toast-progress { background: var(--warning); }
.toast-info .toast-progress { background: var(--accent); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Print styles */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .no-print {
        display: none !important;
    }

    .navbar {
        display: none !important;
    }

    main.container,
    .container {
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .glass-card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .print-page {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
    }

    .print-table th,
    .print-table td {
        border: 1px solid #333;
        padding: 6px 8px;
        font-size: 10pt;
    }

    .print-table th {
        background: #f0f0f0 !important;
        font-weight: bold;
    }

    .print-header {
        text-align: center;
        margin-bottom: 20px;
    }

    .print-header h1 {
        font-size: 16pt;
        margin-bottom: 4px;
    }

    .print-header p {
        font-size: 11pt;
        color: #666;
    }

    .print-footer {
        margin-top: 30px;
        display: flex;
        justify-content: space-between;
    }

    .signature-line {
        width: 200px;
        border-top: 1px solid #333;
        padding-top: 4px;
        text-align: center;
        font-size: 9pt;
    }
}

/* Mobile hamburger menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    flex-direction: column;
    transition: right 0.3s ease;
    pointer-events: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.mobile-user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-menu-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.mobile-menu-close:hover {
    color: var(--text-primary);
}

.mobile-menu-links {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    min-height: 0;
}


.mobile-nav-link {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.15s ease;
    position: relative;
    z-index: 2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Reset for <button> elements */
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    font-weight: inherit;
}

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

.mobile-menu-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
}

.mobile-nav-link.theme-toggle-link {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav-link.theme-toggle-link .theme-icon {
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}


.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Desktop nav visible, mobile hidden by default */
.desktop-nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Mobile breakpoint */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-menu {
        display: flex;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    /* Smaller stat cards on mobile */
    .stat-card {
        padding: 0.5rem 0.25rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.625rem;
    }

    /* Smaller section titles */
    .section-title {
        font-size: 1rem;
    }

    /* Tighter glass card padding */
    .glass-card {
        padding: 1rem;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .btn-sm {
        padding: 0.3125rem 0.625rem;
        font-size: 0.75rem;
    }

    /* Form controls */
    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.9375rem;
    }

    .form-label {
        font-size: 0.8125rem;
    }

    /* Grid gap */
    .grid {
        gap: 0.75rem;
    }

    /* Alert padding */
    .alert {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Modal */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
}

.modal-footer-right {
    display: flex;
    gap: 0.5rem;
}

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

.modal-close:hover {
    color: var(--text-primary);
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.2s ease forwards;
}

/* Site Footer */
.site-footer {
    margin-top: 2rem;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.site-footer-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (max-width: 480px) {
    .site-footer {
        padding: 1rem 0.75rem;
    }

    .site-footer-content {
        font-size: 0.75rem;
    }
}

.footer-version-link {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px dashed var(--text-muted);
    transition: color 0.2s, border-color 0.2s;
}

.footer-version-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* PWA Install */
.pwa-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.pwa-install-btn:hover {
    background: var(--accent);
    color: white;
}

.pwa-install-login {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

.pwa-ios-hint {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

.pwa-installed-msg {
    display: inline-block;
    padding: 0.75rem 1rem;
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--success);
}

/* Version notification card */
.version-card {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    animation: versionFadeIn 0.4s ease-out;
}

@keyframes versionFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.version-card-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.version-card-content {
    flex: 1;
    min-width: 0;
}

.version-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.version-card-badge {
    display: inline-flex;
    align-items: center;
    background: var(--success-light);
    color: var(--success);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    text-transform: uppercase;
}

.version-card-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
}

.version-card-link:hover {
    text-decoration: underline;
}

.version-card-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.version-card-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

@media (max-width: 500px) {
    .version-card {
        padding: 0.875rem 1rem;
        gap: 0.625rem;
    }

    .version-card-icon {
        font-size: 1.5rem;
    }

    .version-card-title {
        font-size: 0.875rem;
    }

    .version-card-link {
        font-size: 0.8rem;
    }
}

/* Password generator */
.password-helper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-top: 0.375rem;
}

.password-generator-link {
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.password-generator-link:hover {
    text-decoration: underline;
}

.password-copied-msg {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: 6px;
    color: var(--success);
    font-size: 0.875rem;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive table for mobile */
@media (max-width: 640px) {
    .table-mobile-card {
        display: block;
    }

    .table-mobile-card thead {
        display: none;
    }

    .table-mobile-card tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .table-mobile-card tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 1rem;
    }

    .table-mobile-card td {
        display: flex;
        justify-content: space-between;
        padding: 0.375rem 0;
        border: none;
    }

    .table-mobile-card td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
    }
}

/* User info in navbar */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Month/Year navigation */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.month-title {
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    color: var(--text-primary);
}

@media (min-width: 640px) {
    .month-title {
        font-size: 1.25rem;
    }
}

/* Page title centered */
.page-title-centered {
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Week navigation */
.week-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.week-nav-title {
    text-align: center;
    flex: 1;
    min-width: 0;
}

.week-nav-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

@media (max-width: 480px) {
    .week-nav-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .week-nav-title {
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .week-nav-header .btn {
        flex: 1;
    }

    .week-nav-subtitle {
        font-size: 0.75rem;
    }
}

/* Dashboard greeting */
.dashboard-greeting {
    text-align: center;
    padding: 0.25rem 0;
}

.greeting-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.greeting-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

@media (min-width: 640px) {
    .greeting-text {
        font-size: 1.6rem;
    }

    .greeting-date {
        font-size: 1rem;
    }
}

/* Confirmation modal */
.confirm-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.confirm-modal-backdrop.active {
    display: flex;
}

.confirm-modal-box {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    text-align: center;
    animation: confirmModalIn 0.2s ease-out;
}

@keyframes confirmModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-modal-body {
    padding: 2rem 1.75rem 0.75rem;
}

.confirm-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.confirm-modal-icon.icon-danger { background: var(--error-light); }
.confirm-modal-icon.icon-warning { background: var(--warning-light); }
.confirm-modal-icon.icon-success { background: var(--success-light); }

.confirm-modal-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.confirm-modal-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.625rem;
    padding: 1.25rem 1.75rem 1.75rem;
}

.confirm-modal-actions .btn {
    flex: 1;
    padding: 0.6875rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    opacity: 0.9;
}

/* Dark mode form controls — suppress any warm/yellow tint */
[data-theme="dark"] .form-control {
    border-color: rgba(100, 120, 150, 0.35) !important;
    outline: none !important;
}
[data-theme="dark"] .form-control:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light) !important;
}

/* Dark mode gombok — tompított kitöltés */
[data-theme="dark"] .btn-primary {
    background: rgba(90, 152, 200, 0.22);
    color: #82bce8;
}
[data-theme="dark"] .btn-primary:hover {
    background: rgba(90, 152, 200, 0.32);
    opacity: 1;
}

[data-theme="dark"] .btn-success {
    background: rgba(82, 176, 122, 0.22);
    color: #72c892;
}
[data-theme="dark"] .btn-success:hover {
    background: rgba(82, 176, 122, 0.32);
    opacity: 1;
}

[data-theme="dark"] .btn-danger {
    background: rgba(212, 128, 128, 0.22);
    color: #e89898;
}
[data-theme="dark"] .btn-danger:hover {
    background: rgba(212, 128, 128, 0.32);
    opacity: 1;
}

[data-theme="dark"] .btn-shift-start {
    background: linear-gradient(135deg, #4a90c4 0%, #2d6a9f 100%);
    box-shadow: 0 2px 8px rgba(74, 144, 196, 0.25);
}
[data-theme="dark"] .btn-shift-start:hover {
    box-shadow: 0 4px 16px rgba(74, 144, 196, 0.35);
}

[data-theme="dark"] .btn-shift-stop {
    background: linear-gradient(135deg, #b86060 0%, #8a4040 100%);
    box-shadow: 0 2px 8px rgba(184, 96, 96, 0.25);
}
[data-theme="dark"] .btn-shift-stop:hover {
    box-shadow: 0 4px 16px rgba(184, 96, 96, 0.35);
}

[data-theme="dark"] .btn-shift-save {
    background: linear-gradient(135deg, #4a9e72 0%, #2d7a50 100%);
    box-shadow: 0 2px 8px rgba(74, 158, 114, 0.25);
}
[data-theme="dark"] .btn-shift-save:hover {
    box-shadow: 0 4px 16px rgba(74, 158, 114, 0.35);
}

[data-theme="dark"] .btn-warning {
    background: rgba(204, 170, 68, 0.22);
    color: #dcc060;
}
[data-theme="dark"] .btn-warning:hover {
    background: rgba(204, 170, 68, 0.32);
    opacity: 1;
}


[data-theme="dark"] .btn-secondary {
    background: rgba(200, 208, 220, 0.10);
    color: var(--text-primary);
    border-color: var(--border-color);
}
[data-theme="dark"] .btn-secondary:hover {
    background: rgba(200, 208, 220, 0.18);
}

/* Dark mode tab gombok — btn-primary dark megfelelője */
[data-theme="dark"] .tab-btn.active {
    background: rgba(90, 152, 200, 0.22);
    color: #82bce8;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.admin-tab {
    padding: 0.5rem 1.125rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.admin-tab-short {
    display: none;
}

@media (max-width: 640px) {
    .admin-tabs {
        gap: 0.25rem;
    }
    .admin-tab {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    .admin-tab:has(.admin-tab-short) > .admin-tab-label { display: none; }
    .admin-tab-short { display: inline; }
}

/* Dark mode admin tab — tompított aktív állapot */
[data-theme="dark"] .admin-tab.active {
    background: rgba(90, 152, 200, 0.22);
    color: #82bce8;
    border-color: rgba(90, 152, 200, 0.45);
}
[data-theme="dark"] .admin-tab.active:hover {
    background: rgba(90, 152, 200, 0.30);
}

/* Dark mode badge-ek */
[data-theme="dark"] .badge-admin {
    background: rgba(90, 152, 200, 0.18);
    color: #82bce8;
}
[data-theme="dark"] .badge-active {
    background: rgba(82, 176, 122, 0.18);
    color: #72c892;
}
[data-theme="dark"] .badge-disabled {
    background: rgba(212, 128, 128, 0.18);
    color: #e89898;
}
[data-theme="dark"] .badge-locked {
    background: rgba(82, 176, 122, 0.18);
    color: #72c892;
}

/* Dark mode alert-ek */
[data-theme="dark"] .alert-success {
    background: rgba(82, 176, 122, 0.14);
    color: #72c892;
    border-color: rgba(82, 176, 122, 0.40);
}
[data-theme="dark"] .alert-error {
    background: rgba(212, 128, 128, 0.14);
    color: #e89898;
    border-color: rgba(212, 128, 128, 0.40);
}
[data-theme="dark"] .alert-warning {
    background: rgba(204, 170, 68, 0.14);
    color: #dcc060;
    border-color: rgba(204, 170, 68, 0.40);
}
[data-theme="dark"] .alert-info {
    background: rgba(90, 152, 200, 0.14);
    color: #82bce8;
    border-color: rgba(90, 152, 200, 0.40);
}

/* ============================================
   Page Title & Subtitle (shared)
   ============================================ */

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

@media (min-width: 640px) {
    .page-title {
        font-size: 1.5rem;
    }
}

.page-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

/* ============================================
   Period Navigation (shared: overview, charts, week)
   ============================================ */

.period-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.period-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

@media (hover: hover) {
    .period-nav-btn:hover:not(:disabled):not(.btn-off) {
        border-color: var(--accent);
        color: var(--accent);
    }
}

.period-nav-btn:active:not(:disabled):not(.btn-off) {
    transform: scale(0.92);
    border-color: var(--accent);
    color: var(--accent);
}

.period-nav-btn:focus,
.period-today-btn:focus {
    outline: none;
    background: var(--bg-secondary);
}

.period-nav-btn:disabled,
.period-today-btn:disabled,
.period-nav-btn.btn-off {
    opacity: 0.3;
    cursor: not-allowed;
}

.period-nav-btn.btn-off {
    pointer-events: none;
}

.period-label {
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    min-width: 150px;
    line-height: 1.3;
}

.period-label small {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.period-today-btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.15s, background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

@media (hover: hover) {
    .period-today-btn:hover {
        background: var(--accent);
        color: white;
    }
}

.period-today-btn:active {
    transform: scale(0.95);
}

/* ============================================
   Chart Styles
   ============================================ */

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    box-sizing: border-box;
}

.chart-container canvas {
    display: block;
}

@media (min-width: 640px) {
    .chart-container {
        height: 300px;
    }
}

.chart-tabs {
    display: flex;
    margin-bottom: 1rem;
    justify-content: center;
}

.tab-btn {
    padding: 0.55rem 1.25rem;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.15s ease;
    min-width: 80px;
}
.tab-btn:first-child { border-radius: 8px 0 0 8px; }
.tab-btn:last-child { border-radius: 0 8px 8px 0; }
.tab-btn:not(:first-child):not(.active) { border-left: none; }

@media (hover: hover) {
    .tab-btn:not(.active):hover {
        background: var(--bg-primary);
    }
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 500;
    position: relative;
    z-index: 1;
}
.tab-btn.active + .tab-btn {
    border-left-color: var(--accent);
}

/* ============================================
   Overview — Calendar & Day Types
   ============================================ */

/* Mobile day picker */
.mobile-day-picker {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mobile-day-picker input {
    flex: 1;
}

/* Day type badges in list */
.day-type-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 500;
    margin-left: 0.25rem;
}

.day-type-badge-vacation {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(34, 197, 94);
}

.day-type-badge-sick {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(239, 68, 68);
}

.day-type-badge-holiday {
    background: rgba(234, 179, 8, 0.2);
    color: rgb(234, 179, 8);
}

.day-type-badge-rest_day {
    background: rgba(100, 140, 200, 0.2);
    color: rgb(100, 140, 200);
}

/* Stat card colors for day types */
.stat-card-vacation {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.1);
}

.stat-card-vacation .stat-value {
    color: rgb(34, 197, 94);
}

.stat-card-sick {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

.stat-card-sick .stat-value {
    color: rgb(239, 68, 68);
}

.stat-card-holiday {
    border-color: rgba(234, 179, 8, 0.4);
    background: rgba(234, 179, 8, 0.1);
}

.stat-card-holiday .stat-value {
    color: rgb(234, 179, 8);
}

.stat-card-rest-day {
    border-color: rgba(100, 140, 200, 0.4);
    background: rgba(100, 140, 200, 0.1);
}

.stat-card-rest-day .stat-value {
    color: rgb(100, 140, 200);
}

/* Dark mode — day type badges and stat cards */
[data-theme="dark"] .day-type-badge-vacation {
    background: rgba(74, 158, 112, 0.15);
    color: #6abf8a;
}
[data-theme="dark"] .day-type-badge-sick {
    background: rgba(200, 114, 114, 0.15);
    color: #e09090;
}
[data-theme="dark"] .day-type-badge-holiday {
    background: rgba(192, 152, 56, 0.15);
    color: #d4b054;
}
[data-theme="dark"] .day-type-badge-rest_day {
    background: rgba(100, 140, 200, 0.15);
    color: #7ab4e0;
}

[data-theme="dark"] .stat-card-vacation {
    border-color: rgba(74, 158, 112, 0.30);
    background: rgba(74, 158, 112, 0.08);
}
[data-theme="dark"] .stat-card-vacation .stat-value {
    color: #6abf8a;
}
[data-theme="dark"] .stat-card-sick {
    border-color: rgba(200, 114, 114, 0.30);
    background: rgba(200, 114, 114, 0.08);
}
[data-theme="dark"] .stat-card-sick .stat-value {
    color: #e09090;
}
[data-theme="dark"] .stat-card-holiday {
    border-color: rgba(192, 152, 56, 0.30);
    background: rgba(192, 152, 56, 0.08);
}
[data-theme="dark"] .stat-card-holiday .stat-value {
    color: #d4b054;
}
[data-theme="dark"] .stat-card-rest-day {
    border-color: rgba(100, 140, 200, 0.30);
    background: rgba(100, 140, 200, 0.08);
}
[data-theme="dark"] .stat-card-rest-day .stat-value {
    color: #7ab4e0;
}

/* Week navigation container */
.week-nav-container {
    margin-bottom: 1rem;
}

/* Special days grid */
.special-days-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.special-days-grid .stat-card {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 120px;
}

@media (min-width: 640px) {
    .special-days-grid .stat-card {
        flex: 1 1 calc(25% - 0.75rem);
        max-width: calc(25% - 0.75rem);
    }
}

/* ============================================
   Changelog
   ============================================ */

.changelog-card {
    max-width: 800px;
    margin: 0 auto;
}

.changelog-version {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.changelog-version:last-child {
    margin-bottom: 0;
}

.changelog-version.cl-open {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.version-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    user-select: none;
    flex-wrap: wrap;
    transition: background 0.15s ease;
}

.version-header:hover {
    background: var(--bg-primary);
}

.version-badge {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
}

.version-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.version-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag-latest {
    background: var(--success-light);
    color: var(--success);
}

.version-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
}

.changelog-version.cl-open .version-summary {
    display: none;
}

.version-arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.changelog-version.cl-open .version-arrow {
    transform: rotate(180deg);
}

.changelog-version.cl-open .version-summary + .version-arrow {
    margin-left: 0;
}

/* Collapsible content */
.version-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.changelog-version.cl-open .version-content {
    max-height: 1000px;
}

.version-content-inner {
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid var(--border-color);
}

.change-group {
    margin-bottom: 0.75rem;
}

.change-group:last-child {
    margin-bottom: 0;
}

.change-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.change-group-title.cl-added { color: var(--success); }
.change-group-title.cl-fixed { color: var(--accent); }
.change-group-title.cl-changed { color: var(--warning); }
.change-group-title.cl-removed { color: var(--error); }

.change-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.change-list li {
    position: relative;
    padding: 0.25rem 0 0.25rem 1.15rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.change-list li::before {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.65rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
}

.change-group.cl-added .change-list li::before { background: var(--success); }
.change-group.cl-fixed .change-list li::before { background: var(--accent); }
.change-group.cl-changed .change-list li::before { background: var(--warning); }
.change-group.cl-removed .change-list li::before { background: var(--error); }

.cl-badge-admin {
    display: inline-flex;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.08rem 0.35rem;
    border-radius: 3px;
    background: rgba(128, 90, 213, 0.1);
    color: #805ad5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 0.35rem;
    vertical-align: middle;
}

[data-theme="dark"] .cl-badge-admin {
    background: rgba(183, 148, 244, 0.15);
    color: #b794f4;
}

/* ============================================
   About Page
   ============================================ */

.about-card {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.about-hero {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.about-logo {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.about-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.about-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.about-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Features grid */
.about-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 500px) {
    .about-features-grid {
        grid-template-columns: 1fr;
    }
}

.about-feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.about-feature-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.about-feature-icon {
    font-size: 1.5rem;
    margin-bottom: 0.375rem;
}

.about-feature-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.about-feature-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* PWA badge */
.about-pwa-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--success-light);
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Steps */
.about-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.about-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
}

.about-step-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-step-content {
    flex: 1;
    padding-top: 0.15rem;
}

.about-step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.about-step-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.about-step-connector {
    width: 2px;
    height: 1.25rem;
    background: var(--border-color);
    margin-left: 1.2rem;
}

/* Audience grid */
.about-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 500px) {
    .about-audience-grid {
        grid-template-columns: 1fr;
    }
}

.about-audience-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    gap: 0.25rem;
}

.about-audience-icon {
    font-size: 1.75rem;
    margin-bottom: 0.125rem;
}

.about-audience-item strong {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.about-audience-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Security grid */
.about-security-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 500px) {
    .about-security-grid {
        grid-template-columns: 1fr;
    }
}

.about-security-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.about-security-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.about-security-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.about-security-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* CTA */
.about-cta {
    text-align: center;
    padding: 1rem 0 0;
}

.about-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.about-btn-cta:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

/* ============================================
   Impersonate Banner
   ============================================ */

.impersonate-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: #d69e2e;
    color: #1a202c;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    flex-wrap: wrap;
}

.impersonate-banner-text {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.impersonate-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    color: #1a202c;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.impersonate-banner-btn:hover {
    background: rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .impersonate-banner {
    background: rgba(204, 170, 68, 0.25);
    color: #dcc060;
}

[data-theme="dark"] .impersonate-banner-btn {
    background: rgba(204, 170, 68, 0.2);
    color: #dcc060;
    border-color: rgba(204, 170, 68, 0.4);
}

[data-theme="dark"] .impersonate-banner-btn:hover {
    background: rgba(204, 170, 68, 0.35);
}

/* ============================================
   Dashboard — Pulse Animation
   ============================================ */

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   Mobile Calendar Grid (overview — cal-*)
   ============================================ */

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-dayheader {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0.3rem 0;
}

.cal-dayheader.cal-weekend-header {
    color: var(--error);
    opacity: 0.7;
}

.cal-cell {
    aspect-ratio: 1;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.cal-cell:hover:not(.empty) {
    border-color: var(--accent);
}

.cal-cell.empty {
    border: none;
    cursor: default;
}

.cal-cell.cal-today {
    background: var(--accent-light);
    border-color: var(--accent);
    border-width: 1.5px;
    border-style: dashed;
}
.cal-cell.cal-today.cal-work {
    background: linear-gradient(135deg, var(--success-light) 50%, var(--accent-light) 50%);
}

.cal-cell.cal-future {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.cal-cell.cal-work { background: var(--success-light); }
.cal-cell.cal-rest { background: rgba(100, 140, 200, 0.08); }
[data-theme="dark"] .cal-cell.cal-rest { background: rgba(100, 140, 200, 0.1); }
.cal-cell.cal-sick { background: var(--error-light); }
.cal-cell.cal-vacation { background: var(--accent-light); }
.cal-cell.cal-holiday { background: var(--warning-light); }

.cal-cell.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.cal-daynum {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.cal-hours {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--success);
    line-height: 1;
    margin-top: 1px;
}

.cal-km {
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

.cal-type-label {
    font-size: 0.5rem;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1;
    margin-top: 1px;
}

.cal-type-label-long {
    display: none;
}

.cal-vehicle {
    display: none;
}

.cal-multi-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 0.45rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--bg-card);
}

/* --- Detail Panel --- */

.cal-detail-panel {
    border-top: 1px solid var(--border-color);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.cal-detail-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.75rem 0;
}

.cal-detail-empty-day {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.5rem 0;
}

.cal-detail-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cal-detail-day-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.cal-detail-day-type {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
}

.cal-detail-day-type.munkanap { background: #d4edda; color: #155724; }
[data-theme="dark"] .cal-detail-day-type.munkanap { background: #1a3a2a; color: #6fcf97; }
.cal-detail-day-type.szabadsag { background: #cce5ff; color: #004085; }
[data-theme="dark"] .cal-detail-day-type.szabadsag { background: #1a2a4a; color: #6cb3ff; }
.cal-detail-day-type.betegseg { background: #f8d7da; color: #721c24; }
[data-theme="dark"] .cal-detail-day-type.betegseg { background: #3a1a1a; color: #f5a0a0; }
.cal-detail-day-type.unnepnap { background: #fff3cd; color: #856404; }
[data-theme="dark"] .cal-detail-day-type.unnepnap { background: #3d3200; color: #ffc107; }
.cal-detail-day-type.pihenonap { background: #e2e3e5; color: #383d41; }
[data-theme="dark"] .cal-detail-day-type.pihenonap { background: #2a2a3e; color: #aaa; }

/* Single/multi shift fields */
.cal-detail-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.cal-detail-field {
    display: flex;
    flex-direction: column;
}

.cal-detail-full {
    grid-column: 1 / -1;
}

.cal-detail-field-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cal-detail-field-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.cal-detail-km-range {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.cal-detail-km-arrow {
    color: var(--text-muted);
    font-size: 0.65rem;
}

/* Ongoing shift indicators */
.ongoing-dots {
    color: var(--accent);
    font-weight: 700;
}

.ongoing-tag {
    display: inline-block;
    font-size: 0.58rem;
    color: #fff;
    background: var(--accent);
    padding: 0 0.3rem;
    border-radius: 3px;
    vertical-align: middle;
    line-height: 1.4;
}

.cal-ongoing {
    color: var(--accent);
    font-size: 0.6rem;
}

/* Multi-shift detail */
.cal-detail-shift {
    padding-top: 0.375rem;
}

.cal-detail-shift:not(:first-child) {
    border-top: 1px dashed var(--border-color);
    margin-top: 0.375rem;
    padding-top: 0.5rem;
}

.cal-detail-shift-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cal-detail-shift-num {
    color: var(--accent);
    font-size: 0.95rem;
}

.cal-detail-shift-edit {
    margin-left: auto;
    font-size: 0.7rem !important;
    padding: 0.15rem 0.5rem !important;
}

.cal-detail-day-total {
    border-top: 2px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cal-detail-total-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-detail-total-values {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.85rem;
}

.cal-detail-total-hours {
    color: var(--success);
}

.cal-detail-total-sep {
    color: var(--text-muted);
}

.cal-detail-total-km {
    color: var(--accent);
}

.cal-detail-actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
}

.cal-detail-animate {
    animation: calDetailSlide 0.2s ease;
}

@keyframes calDetailSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Desktop responsive --- */
@media (min-width: 640px) {
    .cal-grid {
        gap: 0.5rem;
    }

    .cal-cell {
        aspect-ratio: auto;
        min-height: 90px;
        border-radius: 10px;
        padding: 0.5rem 0.35rem;
    }

    .cal-dayheader {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    .cal-daynum {
        font-size: 0.85rem;
    }

    .cal-vehicle {
        display: block;
        font-size: 0.55rem;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1.4;
        margin-top: 2px;
    }

    .cal-hours {
        font-size: 0.6rem;
    }

    .cal-km {
        font-size: 0.55rem;
    }

    .cal-type-label {
        display: none;
    }

    .cal-type-label-long {
        display: block;
        font-size: 0.65rem;
        font-weight: 600;
        color: var(--text-muted);
        text-align: center;
        word-break: break-word;
        line-height: 1.1;
        margin-top: 0.125rem;
    }

    .cal-cell.cal-vacation .cal-type-label-long { color: rgb(34, 197, 94); }
    .cal-cell.cal-sick .cal-type-label-long { color: rgb(239, 68, 68); }
    .cal-cell.cal-holiday .cal-type-label-long { color: rgb(234, 179, 8); }
    .cal-cell.cal-rest .cal-type-label-long { color: rgb(100, 140, 200); }

    .cal-multi-badge {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
        top: -4px;
        right: -4px;
    }

    .cal-detail-panel {
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .cal-detail-day-name {
        font-size: 1.05rem;
    }

    .cal-detail-fields {
        font-size: 0.85rem;
        gap: 0.35rem 1rem;
    }

    .cal-detail-field-value {
        font-size: 0.85rem;
    }

    .cal-detail-km-range {
        font-size: 0.85rem;
    }
}

/* ==========================================
   GPS location button
   ========================================== */
.input-with-gps {
    display: flex;
    gap: 0.25rem;
}

.input-with-gps .form-control {
    flex: 1;
    min-width: 0;
}

.gps-btn {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, border-color 0.15s;
}

.gps-btn:hover {
    background: var(--accent-light, rgba(59, 130, 246, 0.1));
    border-color: var(--accent, #3b82f6);
}

.gps-btn:disabled {
    cursor: wait;
    opacity: 0.6;
}

.gps-btn-loading {
    animation: gps-pulse 1s ease-in-out infinite;
}

@keyframes gps-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Shift save button */
.btn-shift-save {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.3);
    transition: all 0.2s ease;
}

.btn-shift-save:hover {
    box-shadow: 0 4px 16px rgba(56, 161, 105, 0.4);
    transform: translateY(-1px);
}

.btn-shift-save:active {
    transform: translateY(0) scale(0.98);
}

/* Shift action buttons container — full width on mobile only */
.shift-action-btns {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .shift-action-btns .btn {
        flex: 1;
    }
}

/* Collapsible section — dashboard optional fields */
.dash-collapsible-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: 0.75rem;
}

.dash-collapsible-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.dash-collapsible-toggle .dash-arrow {
    transition: transform 0.25s ease;
    font-size: 0.75rem;
}

.dash-collapsible-toggle.open .dash-arrow {
    transform: rotate(180deg);
}

.dash-collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 0;
}

.dash-collapsible-content.open {
    max-height: 600px;
    opacity: 1;
}
