/* ============================================
   Design System — Radiant Hours Hub
   Pixel-refined vs Lovable reference
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #FF5A47;
    --primary-hover: #FF4B35;
    --danger: #FF3D3D;
    --success: #24B36B;
    --background: #FFF9F3;
    --card: #FFFFFF;
    --light-gray: #F9F8F3;
    --tile-bg: #F9F8F3;
    --border: #ECE7E2;
    --text-primary: #27213C;
    --text-secondary: #7B7385;
    --inactive: #B8B3C0;
    --nav-dark: #1E1B2E;
    --icon-btn-bg: #F0EDE8;

    --primary-color: var(--primary);
    --primary-dark: var(--primary-hover);
    --secondary-color: var(--success);
    --danger-color: var(--danger);
    --warning-color: #F5A623;
    --bg-color: var(--background);
    --card-bg: var(--card);
    --border-color: var(--border);
    --shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 38px rgba(0, 0, 0, 0.1);

    --radius-pill: 9999px;
    --radius-sm: 16px;
    --radius-md: 28px;
    --radius-lg: 32px;

    --space-section: 32px;
    --space-card: 20px;
    --space-gap: 16px;
}

html {
    scroll-behavior: smooth;
}

/* ---- Background: mesh gradient (ref) ---- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    background-image:
        radial-gradient(ellipse 80% 60% at 0% 0%, rgba(255, 235, 180, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 5%, rgba(180, 240, 210, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 90% 50% at 50% 100%, rgba(255, 210, 200, 0.35) 0%, transparent 55%),
        linear-gradient(180deg, #FFF5E6 0%, #FFF0F3 40%, #F0FFF8 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
}

#app {
    padding-bottom: 96px;
}

/* ---- Top Bar ---- */
.app-header {
    background: transparent;
    box-shadow: none;
    padding: 16px 20px 4px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
}

.page-header-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1;
}

.page-header-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.top-bar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    padding-top: 2px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--icon-btn-bg);
    box-shadow: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 0;
}

.icon-btn:hover {
    transform: scale(1.02);
    background: #E8E4DE;
}

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

.icon-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* ---- App Content ---- */
.app-content {
    padding: 12px 20px 24px;
    animation: fadeInUp 0.3s ease-out;
}

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

/* ---- Summary Card ---- */
.summary-card {
    background: linear-gradient(145deg, #3D1A38 0%, #6B2D5B 30%, #9E3668 65%, #C44569 100%);
    border-radius: var(--radius-lg);
    padding: 24px 20px 20px;
    margin-bottom: 24px;
    box-shadow: 0 12px 40px rgba(61, 26, 56, 0.28);
    color: #fff;
}

.summary-card-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 10px;
    line-height: 1.4;
}

.summary-card-title {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.92;
    margin-bottom: 6px;
}

.summary-card-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.summary-card-value {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.summary-card-unit {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.75;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.summary-stat {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-stat-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.75;
}

.summary-stat-header svg {
    width: 13px;
    height: 13px;
    opacity: 0.85;
    flex-shrink: 0;
}

.summary-stat-value {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

/* ---- Payout summary (bottom of work-time) ---- */
.payout-summary {
    background: linear-gradient(145deg, #12352E 0%, #1A5343 38%, #247A5C 72%, #2F9B6A 100%);
    border-radius: var(--radius-lg);
    padding: 24px 20px 20px;
    margin-top: 28px;
    margin-bottom: 8px;
    box-shadow: 0 12px 40px rgba(18, 53, 46, 0.28);
    color: #fff;
}

.payout-summary-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 10px;
    line-height: 1.4;
}

.payout-summary-title {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.92;
    margin-bottom: 6px;
}

.payout-summary-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.payout-summary-value {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.payout-summary-unit {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.75;
}

/* ---- Section Header ---- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.section-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ---- Employee Card ---- */
.employee-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-gap);
    padding: 0;
    margin: 0;
}

.employee-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: var(--space-card);
    padding-top: calc(var(--space-card) + 4px);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    list-style: none;
}

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

.employee-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.employee-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.employee-card-info {
    flex: 1;
    min-width: 0;
}

.employee-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1.25;
    transition: color 0.2s;
}

.employee-card-name:hover {
    color: var(--primary);
}

.employee-card-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

/* ---- Status Badge ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-badge--active {
    background: rgba(36, 179, 107, 0.14);
    color: var(--success);
}

.status-badge--active::before {
    background: var(--success);
}

.status-badge--idle {
    background: #EEEBE6;
    color: var(--text-secondary);
}

.status-badge--idle::before {
    background: var(--inactive);
}

/* ---- Info Tile ---- */
.info-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.info-tile {
    background: var(--tile-bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.info-tile-header {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.35;
}

.info-tile-header svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.65;
    margin-top: 1px;
}

.info-tile-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.info-tile-value--danger {
    color: var(--danger);
}

.info-tile-value--success {
    color: var(--success);
}

.info-tile-value--muted {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ---- Employee Card Actions ---- */
.employee-card-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 11px 8px;
    border-radius: var(--radius-pill);
    border: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.btn-action svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn-action:hover {
    transform: scale(1.02);
}

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

.btn-action-neutral {
    background: var(--tile-bg);
    color: var(--text-primary);
}

.btn-action-neutral:hover {
    background: #EEEBE6;
}

.btn-action-info {
    background: #E3EDFA;
    color: #2D4A7A;
}

.btn-action-info:hover {
    background: #D4E3F8;
}

.btn-action-primary {
    background: var(--primary);
    color: #fff;
}

.btn-action-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 16px rgba(255, 90, 71, 0.3);
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
    position: fixed;
    bottom: 14px;
    left: 20px;
    right: 20px;
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.bottom-nav-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--nav-dark);
    border-radius: var(--radius-pill);
    padding: 6px 8px;
    box-shadow: 0 10px 36px rgba(30, 27, 46, 0.4);
    width: 100%;
    max-width: 400px;
}

.nav-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius-pill);
    margin: 0;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    min-width: 44px;
}

.nav-item:hover {
    color: rgba(255, 255, 255, 0.75);
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
    flex: 1;
    padding: 10px 18px;
    box-shadow: 0 2px 10px rgba(255, 90, 71, 0.35);
}

.nav-item-icon {
    font-size: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item-icon svg {
    width: 20px;
    height: 20px;
}

.nav-item-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-item:not(.active) .nav-item-label {
    display: none;
}

.nav-item:not(.active) {
    padding: 10px 12px;
}

/* ---- App Card (generic) ---- */
.app-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: var(--space-card);
    margin-bottom: var(--space-gap);
    box-shadow: var(--shadow);
}

.app-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ---- Buttons (global) ---- */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-block;
    text-align: center;
    width: 100%;
}

.btn:hover { transform: scale(1.02); }
.btn:active { transform: scale(0.98); }

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 16px rgba(255, 90, 71, 0.3);
}

.btn-secondary {
    background: #E3EDFA;
    color: #2D4A7A;
}

.btn-secondary:hover {
    background: #D4E3F8;
}

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

.btn-danger:hover {
    background: #E63535;
}

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

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

.btn-small {
    padding: 10px 18px;
    font-size: 13px;
    width: auto;
}

/* ---- Cards (legacy) ---- */
.card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: var(--space-card);
    margin-bottom: var(--space-gap);
    box-shadow: var(--shadow);
    border: none;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.employee-item {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: var(--space-card);
    margin-bottom: var(--space-gap);
    box-shadow: var(--shadow);
    border-left: none;
    border-top: 4px solid var(--primary);
}

.employee-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.employee-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.stat-item {
    background: var(--tile-bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---- Grid Calendar (Czas pracy) ---- */
.calendar-container {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: var(--space-card);
    margin-bottom: var(--space-gap);
    box-shadow: var(--shadow);
}

.work-time-calendar {
    padding: 16px 20px 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.calendar-month {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    flex: 1;
    letter-spacing: -0.01em;
}

.calendar-nav-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.calendar-nav-btn svg {
    width: 18px;
    height: 18px;
}

.calendar-nav-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.03);
}

.calendar-nav-btn:active {
    transform: scale(0.97);
}

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

.calendar-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 0 10px;
    text-transform: capitalize;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-size: 14px;
    font-weight: 600;
    background: var(--tile-bg);
    color: var(--text-primary);
    position: relative;
    padding: 4px;
    border: 2px solid transparent;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.calendar-day.other-month {
    color: var(--inactive);
    opacity: 0.45;
    background: transparent;
    font-weight: 500;
}

.calendar-day.today {
    background: var(--tile-bg);
    color: var(--primary);
    box-shadow: inset 0 0 0 2px var(--primary);
}

.calendar-day.scheduled {
    background: var(--success);
    color: #fff;
}

.calendar-day.absent {
    background: var(--danger);
    color: #fff;
}

.calendar-day.absent::after {
    content: '×';
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.9;
}

.calendar-day.absent.scheduled {
    background: linear-gradient(135deg, var(--success) 0%, var(--danger) 100%);
}

.calendar-day.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(255, 90, 71, 0.35);
    transform: scale(1.05);
}

.calendar-day.selected.scheduled {
    background: var(--primary);
    color: #fff;
}

.calendar-day.selected.today {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 90, 71, 0.35);
}

.calendar-day:hover:not(.other-month) {
    transform: scale(1.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.calendar-day.selected:hover {
    transform: scale(1.06);
}

/* ---- Recent Entries ---- */
.recent-entries-card {
    padding: 20px;
}

.recent-entries-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}

.recent-entries-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-entry-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #F3F1ED;
    position: relative;
    overflow: hidden;
    list-style: none;
}

.recent-entry-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #FF8C42;
}

.recent-entry-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px 16px 18px;
}

.recent-entry-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 140, 66, 0.12);
    color: #FF8C42;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recent-entry-icon svg {
    width: 18px;
    height: 18px;
}

.recent-entry-info {
    flex: 1;
    min-width: 0;
}

.recent-entry-date {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    text-transform: capitalize;
}

.recent-entry-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}

.recent-entry-separator {
    color: var(--inactive);
}

.recent-entry-hours {
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Work Hours Form ---- */
.work-hours-form {
    margin-top: var(--space-gap);
    padding: 20px;
}

.work-hours-form-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.work-hours-form-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.time-display {
    text-align: center;
    padding: 16px;
    background: var(--tile-bg);
    border-radius: var(--radius-sm);
    margin: 16px 0;
    border: 1px solid #F0EEEA;
}

.time-display-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

/* ---- Modal ---- */
.modal-overlay {
    backdrop-filter: blur(6px);
    animation: fadeIn 0.25s ease-out;
}

.modal-overlay .card {
    border-radius: var(--radius-md);
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Form controls ---- */
.form-group input,
.form-group select,
.form-control {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 90, 71, 0.12);
}

/* ---- Login ---- */
.login-page {
    background-color: var(--background);
    background-image:
        radial-gradient(ellipse 80% 60% at 0% 0%, rgba(255, 235, 180, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 5%, rgba(180, 240, 210, 0.45) 0%, transparent 50%),
        linear-gradient(180deg, #FFF5E6 0%, #FFF0F3 40%, #F0FFF8 100%);
}

.login-box {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.login-box .btn-primary,
.login-box .btn {
    background: var(--primary);
}

/* ---- Toast ---- */
.toast {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.payment-separator-text {
    color: var(--primary);
}

.payment-separator-line {
    background-color: var(--primary);
}

/* ---- Vertical Schedule Calendar ---- */
.vertical-calendar-container {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 0;
    box-shadow: var(--shadow);
    margin-bottom: var(--space-gap);
    overflow: hidden;
}

.vertical-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #F0EEEA;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card);
    gap: 12px;
}

.vertical-calendar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    text-align: center;
    letter-spacing: -0.01em;
}

.vertical-calendar-nav-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.vertical-calendar-nav-btn svg {
    width: 18px;
    height: 18px;
}

.vertical-calendar-nav-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.03);
}

.vertical-calendar-nav-btn:active {
    transform: scale(0.97);
}

.vertical-calendar-list {
    display: flex;
    flex-direction: column;
}

.vertical-calendar-day {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #F0EEEA;
    min-height: 76px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.vertical-calendar-day:last-child {
    border-bottom: none;
}

.vertical-calendar-day:hover {
    background: rgba(249, 248, 243, 0.6);
}

.vertical-calendar-day-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    padding: 14px 0;
    flex-shrink: 0;
}

.vertical-calendar-day-number {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.vertical-calendar-day-name {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
    color: var(--text-secondary);
}

.vertical-calendar-day.available .vertical-calendar-day-number,
.vertical-calendar-day.available .vertical-calendar-day-name {
    color: var(--success);
}

.vertical-calendar-day.unavailable .vertical-calendar-day-number,
.vertical-calendar-day.unavailable .vertical-calendar-day-name {
    color: var(--danger);
}

.vertical-calendar-slots {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 8px 10px 0;
    gap: 8px;
    min-width: 0;
}

.vertical-calendar-status {
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.vertical-calendar-status.available {
    background: rgba(36, 179, 107, 0.12);
    color: var(--success);
    padding: 7px 14px;
    align-self: stretch;
}

.vertical-calendar-status.unavailable {
    background: rgba(255, 61, 61, 0.1);
    color: var(--danger);
    padding: 7px 14px;
    align-self: stretch;
}

.vertical-calendar-status.not-working {
    background: rgba(255, 61, 61, 0.08);
    color: var(--danger);
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    border-radius: var(--radius-sm);
}

.vertical-calendar-status.my-shifts {
    background: #F4F6FA;
    border: 1px solid #E8ECF2;
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
}

.my-shifts-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.my-shift-row {
    margin-bottom: 10px;
}

.my-shift-row:last-child {
    margin-bottom: 0;
}

.my-shift-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 6px;
    color: #fff;
    margin-right: 8px;
    vertical-align: middle;
    min-width: 28px;
}

.my-shift-tag-ro {
    background: #FF8C42;
}

.my-shift-tag-hg {
    background: #3498DB;
}

.my-shift-branch-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.my-shift-coworkers {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
    padding-left: 2px;
}

.my-shift-coworkers-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 4px;
}

.vertical-calendar-status.working-split {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.vertical-calendar-status.working-split .branch-col {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.branch-card {
    background: var(--tile-bg);
    border: 1px solid #F0EEEA;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.branch-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    color: #fff;
    width: fit-content;
    letter-spacing: 0.04em;
}

.branch-badge-ro {
    background: #FF8C42;
}

.branch-badge-hg {
    background: #3498DB;
}

.vertical-calendar-status.working-split .status-text {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    word-break: break-word;
    text-align: left;
}

.vertical-calendar-status .status-text {
    display: block;
    font-weight: inherit;
    line-height: inherit;
}

.vertical-calendar-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    padding-right: 8px;
}

.vertical-calendar-add-button {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    color: var(--inactive);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vertical-calendar-add-button svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.vertical-calendar-add-button:hover {
    background: var(--tile-bg);
    color: var(--text-primary);
}

.vertical-calendar-day-name.has-note-underline {
    border-bottom: 2px solid #FFD166;
    padding-bottom: 2px;
}

.vertical-calendar-day.today {
    background: rgba(255, 90, 71, 0.04);
    position: relative;
}

.vertical-calendar-day.today::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.vertical-calendar-day.today .vertical-calendar-day-number {
    color: var(--primary);
}

.vertical-calendar-day.today.available .vertical-calendar-day-number,
.vertical-calendar-day.today.available .vertical-calendar-day-name {
    color: var(--success);
}

.vertical-calendar-day.today.unavailable .vertical-calendar-day-number,
.vertical-calendar-day.today.unavailable .vertical-calendar-day-name {
    color: var(--danger);
}

/* ---- History Modal ---- */
.history-modal-overlay .history-modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(39, 33, 60, 0.18);
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}

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

.history-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 24px 24px 0;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.history-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    max-height: 62vh;
}

.history-modal-footer {
    padding: 0 24px 24px;
}

.btn-modal-close {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-pill);
    background: #EFF6FF;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-modal-close:hover {
    background: #E0EDFC;
    transform: scale(1.01);
}

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

.history-summary {
    padding: 20px 16px;
    margin-bottom: 16px;
    background: #FAFAF9;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid #F0EEEA;
}

.history-summary-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.history-summary-value {
    font-size: 34px;
    font-weight: 700;
    color: var(--success);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.history-summary-detail {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.5;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-entry {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #F3F1ED;
    border-left: 4px solid var(--border);
    list-style: none;
    position: relative;
}

.history-entry--advance {
    border-left-color: #F59E0B;
}

.history-entry--payment {
    border-left-color: var(--success);
}

.history-entry-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.history-entry-main {
    flex: 1;
    min-width: 0;
}

.history-entry-date {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.history-entry-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}

.history-entry-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 8px;
    line-height: 1.3;
}

.history-entry-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-entry-detail {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.45;
}

.history-entry-note {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
    font-style: italic;
}

.btn-history-delete {
    flex-shrink: 0;
    padding: 8px 16px;
    border: none;
    border-radius: 12px;
    background: var(--danger);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    line-height: 1;
    margin-top: 2px;
}

.btn-history-delete:hover {
    background: #E63535;
    transform: scale(1.02);
}

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

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .app-header {
        padding: 14px 20px 2px;
    }

    .app-content {
        padding: 8px 20px 20px;
    }

    .page-header-title {
        font-size: 26px;
    }

    .summary-card-value,
    .payout-summary-value {
        font-size: 34px;
    }

    .summary-stat-value {
        font-size: 15px;
    }

    .summary-stat-header {
        font-size: 8px;
    }

    .btn-action {
        padding: 10px 6px;
        font-size: 11px;
    }

    .bottom-nav {
        left: 16px;
        right: 16px;
        bottom: 12px;
    }

    .history-modal-title {
        font-size: 18px;
        padding: 20px 20px 0;
    }

    .history-modal-body {
        padding: 16px 20px;
    }

    .history-modal-footer {
        padding: 0 20px 20px;
    }

    .history-summary-value {
        font-size: 28px;
    }

    .vertical-calendar-header {
        padding: 14px 16px;
    }

    .vertical-calendar-day-info {
        width: 50px;
    }

    .vertical-calendar-day-number {
        font-size: 20px;
    }

    .vertical-calendar-slots {
        padding-right: 4px;
    }
}

@media (min-width: 768px) {
    .app-content {
        max-width: 480px;
        margin: 0 auto;
        padding-left: 24px;
        padding-right: 24px;
    }

    .app-header {
        max-width: 480px;
        margin: 0 auto;
        padding-left: 24px;
        padding-right: 24px;
    }

    .bottom-nav-inner {
        max-width: 400px;
    }
}

/* ---- Admin day manager (wariant A: jedna lista) ---- */
.admin-day-manager-modal {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(30, 27, 46, 0.48);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.adm-sheet {
    width: 100%;
    max-width: 480px;
    height: min(94dvh, 920px);
    background:
        radial-gradient(ellipse 80% 40% at 0% 0%, rgba(255, 235, 180, 0.4), transparent 55%),
        radial-gradient(ellipse 70% 35% at 100% 100%, rgba(255, 210, 200, 0.28), transparent 50%),
        var(--background);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -12px 40px rgba(39, 33, 60, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.adm-handle {
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: #ddd7d0;
    margin: 10px auto 4px;
    flex-shrink: 0;
}

.adm-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 18px 0;
}

.adm-kicker {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.adm-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.15;
    margin-top: 2px;
}

.adm-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 99px;
    background: var(--icon-btn-bg);
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.adm-close:active {
    transform: scale(0.96);
}

.adm-search-wrap {
    position: relative;
    margin: 14px 16px 0;
}

.adm-search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

.adm-search {
    width: 100%;
    border: 1.5px solid var(--border);
    background: var(--card);
    border-radius: 99px;
    padding: 12px 14px 12px 40px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
}

.adm-search:focus {
    outline: none;
    border-color: #d8cfc6;
}

.adm-filters {
    display: flex;
    gap: 8px;
    padding: 12px 16px 0;
    overflow-x: auto;
}

.adm-filter {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-primary);
    border-radius: 99px;
    padding: 8px 12px;
    min-height: 36px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.adm-filter.is-on {
    background: var(--nav-dark);
    border-color: var(--nav-dark);
    color: #fff;
}

.adm-summary {
    padding: 8px 18px 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.adm-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.adm-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 28px 12px;
}

.adm-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    border-radius: 18px;
    padding: 10px 10px 10px 12px;
    box-shadow: 0 4px 14px rgba(39, 33, 60, 0.05);
}

.adm-card.is-ro {
    border-left-color: #E67E22;
}

.adm-card.is-hg {
    border-left-color: #2980B9;
}

.adm-card.is-ro.is-hg {
    border-left-color: var(--success);
}

.adm-card.is-off {
    background: #FFF4F2;
    border-left-color: var(--danger);
}

.adm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.adm-who {
    flex: 1;
    min-width: 0;
}

.adm-who strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-who span {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

.adm-pills {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.adm-pill {
    min-width: 48px;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 12px;
    border: 1.5px solid;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.adm-pill-ro {
    color: #E67E22;
    border-color: #F3C89A;
}

.adm-pill-hg {
    color: #2980B9;
    border-color: #A9CDE5;
}

.adm-pill-off {
    color: #E74C3C;
    border-color: #F5B7B1;
}

.adm-pill-ro.is-on {
    background: #E67E22;
    border-color: #E67E22;
    color: #fff;
}

.adm-pill-hg.is-on {
    background: #2980B9;
    border-color: #2980B9;
    color: #fff;
}

.adm-pill-off.is-on {
    background: #E74C3C;
    border-color: #E74C3C;
    color: #fff;
}

.adm-pill:active {
    transform: scale(0.96);
}

@media (max-width: 360px) {
    .adm-card {
        flex-wrap: wrap;
    }

    .adm-pills {
        width: 100%;
        justify-content: flex-end;
    }
}

.adm-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    background: rgba(255, 249, 243, 0.92);
    border-top: 1px solid var(--border);
}

.adm-foot .btn {
    width: 100%;
    min-height: 50px;
}

@media (min-width: 768px) {
    .admin-day-manager-modal {
        align-items: center;
        padding: 24px;
    }

    .adm-sheet {
        height: min(88vh, 820px);
        border-radius: 28px;
    }

    .adm-handle {
        display: none;
    }
}
