:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #d9e1ec;
    --primary: #174ea6;
    --primary-dark: #123d82;
    --danger: #b42318;
    --success: #027a48;
    --warning: #b54708;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { font-weight: 800; font-size: 17px; }
.subbrand { font-size: 12px; opacity: .85; }

.navtabs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.navtabs a {
    white-space: nowrap;
    padding: 9px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
}

.container {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 16px;
}

.footer {
    text-align: center;
    padding: 22px 16px;
    color: var(--muted);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(16,24,40,.05);
}

.card h1, .card h2, .card h3 { margin-top: 0; }

.grid {
    display: grid;
    gap: 14px;
}

.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

.stat {
    padding: 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
}

.stat .number { font-size: 30px; font-weight: 900; }
.stat .label { color: var(--muted); font-size: 13px; }

.form-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

label {
    display: block;
    font-weight: 750;
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: 3px solid #dbeafe;
    border-color: var(--primary);
}

.help {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover, button:hover { background: var(--primary-dark); text-decoration: none; }
.btn-light { background: #fff; color: var(--primary); border-color: #fff; }
.btn-secondary { background: #eef4ff; color: var(--primary); border-color: #b8cdf8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { min-height: 34px; padding: 7px 10px; border-radius: 10px; font-size: 13px; }

.alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 700;
}
.alert-success { border-color: #a6f4c5; color: var(--success); background: #ecfdf3; }
.alert-error { border-color: #fecdca; color: var(--danger); background: #fef3f2; }
.alert-warning { border-color: #fedf89; color: var(--warning); background: #fffaeb; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #f8fafc; font-size: 13px; color: #344054; }

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #eef4ff;
    color: var(--primary);
}
.badge-inactive { background: #fef3f2; color: var(--danger); }

.profile-img {
    width: 96px;
    height: 120px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #eef2f7;
}

.kv {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.kv div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfdff;
}
.kv strong { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }

.login-box {
    max-width: 430px;
    margin: 28px auto;
}

@media (min-width: 720px) {
    .container { padding: 24px; }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .form-row { grid-template-columns: repeat(2, 1fr); }
    .kv { grid-template-columns: repeat(2, 1fr); }
}

/* Phase 2 additions */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--muted); }
.inline-form { display: inline; }
.input-small { min-width: 92px; }
.entry-table textarea { min-width: 190px; }
.entry-table input.input-small { max-width: 96px; }
.entry-table select.input-small { max-width: 110px; }
.nowrap { white-space: nowrap; }

@media print {
    .topbar, .navtabs, .footer, .print-hide, .actions { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    table { min-width: 0; font-size: 12px; }
}


/* Phase 2.1 daily bulk entry */
.copy-box {
    display: flex;
    gap: 6px;
    align-items: center;
    min-width: 135px;
}
.copy-box .input-small { max-width: 64px; }
.daily-bulk-table input { min-width: 120px; }
.daily-bulk-table td:nth-child(5) input { min-width: 220px; }
details summary {
    cursor: pointer;
    padding: 10px 0;
}
@media (max-width: 719px) {
    .daily-bulk-table { min-width: 980px; }
}

/* Phase 2.2 - Android-style mobile UI, date calendar picker, input masks */
body {
    background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 260px, #f5f7fb 100%);
}

.topbar {
    box-shadow: 0 6px 22px rgba(23, 78, 166, .18);
}

.navtabs {
    position: sticky;
    top: 65px;
    z-index: 9;
    gap: 10px;
    scrollbar-width: none;
}
.navtabs::-webkit-scrollbar { display: none; }
.navtabs a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(23, 78, 166, .08);
}

.card {
    border-radius: 22px;
    box-shadow: 0 12px 34px rgba(16, 24, 40, .07);
}

input, select, textarea {
    min-height: 48px;
    border-radius: 16px;
    font-size: 16px;
}

textarea { min-height: 72px; }

.btn, button {
    border-radius: 16px;
    min-height: 48px;
}

.date-picker-wrap {
    display: grid;
    grid-template-columns: 1fr 56px;
    gap: 8px;
    align-items: center;
}

.date-picker-wrap .native-date-picker {
    width: 56px;
    min-width: 56px;
    padding: 0;
    text-align: center;
    color: transparent;
    cursor: pointer;
    background: #eef4ff;
    border-color: #b8cdf8;
    position: relative;
}

.date-picker-wrap .native-date-picker::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    width: 28px;
    height: 28px;
    margin: 0 auto;
}

.date-picker-wrap .native-date-picker::before {
    content: "📅";
    color: var(--primary);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 20px;
}

@media (max-width: 719px) {
    .container {
        padding: 12px;
    }

    .topbar {
        padding: 12px 14px;
        border-bottom-left-radius: 18px;
        border-bottom-right-radius: 18px;
    }

    .brand { font-size: 15px; }
    .subbrand { font-size: 11px; }

    .navtabs {
        top: 62px;
        padding: 10px 12px 12px;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(10px);
    }

    .card {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 22px;
    }

    .card h1 { font-size: 22px; }
    .card h2 { font-size: 18px; }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .actions .btn, .actions button { width: 100%; }

    .stat {
        border-radius: 20px;
        padding: 14px;
    }
    .stat .number {
        font-size: 24px;
        word-break: break-word;
    }

    .table-wrap {
        overflow-x: visible;
    }

    table.mobile-card-table,
    table.entry-table,
    table.daily-bulk-table {
        min-width: 0 !important;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 12px;
    }

    table.mobile-card-table thead,
    table.entry-table thead,
    table.daily-bulk-table thead {
        display: none;
    }

    table.mobile-card-table tbody,
    table.entry-table tbody,
    table.daily-bulk-table tbody,
    table.mobile-card-table tr,
    table.entry-table tr,
    table.daily-bulk-table tr,
    table.mobile-card-table td,
    table.entry-table td,
    table.daily-bulk-table td {
        display: block;
        width: 100%;
    }

    table.mobile-card-table tr,
    table.entry-table tr,
    table.daily-bulk-table tr {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 10px;
        box-shadow: 0 8px 22px rgba(16, 24, 40, .06);
    }

    table.mobile-card-table td,
    table.entry-table td,
    table.daily-bulk-table td {
        border-bottom: 1px dashed #e5e7eb;
        padding: 10px 4px;
    }

    table.mobile-card-table td:last-child,
    table.entry-table td:last-child,
    table.daily-bulk-table td:last-child {
        border-bottom: 0;
    }

    table.mobile-card-table td::before,
    table.entry-table td::before,
    table.daily-bulk-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        margin-bottom: 5px;
        text-transform: uppercase;
        letter-spacing: .02em;
    }

    table.mobile-card-table td[data-label="Token No."],
    table.entry-table td[data-label="Token No."],
    table.daily-bulk-table td[data-label="Token No."] {
        font-size: 20px;
        color: var(--primary);
    }

    .daily-bulk-table input,
    .daily-bulk-table td:nth-child(5) input,
    .entry-table textarea,
    .entry-table input.input-small,
    .entry-table select.input-small {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .copy-box {
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr auto;
    }
    .copy-box .input-small { max-width: none; }
}

/* Phase 2.4 - Employee incentive compact day cards */
.day-card-list {
    display: grid;
    gap: 12px;
}

.day-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 14px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .07);
}

.day-card-top {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
}

.day-card-date {
    font-size: 18px;
    font-weight: 900;
    color: var(--text);
}

.day-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.day-pill-muted {
    background: #f1f5f9;
    color: #475569;
}

.day-pill-warning {
    background: #fff7ed;
    color: #c2410c;
}

.day-card-work {
    margin-top: 12px;
    padding: 12px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px dashed #dbe4f0;
}

.day-card-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 5px;
}

.day-card-work-value {
    font-size: 16px;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
}

.day-card-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.day-mini-stat {
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5eaf3;
    padding: 10px 8px;
    min-width: 0;
}

.day-mini-stat .mini-label {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
}

.day-mini-stat .mini-value {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
}

.day-mini-stat .mini-value.text-danger,
.day-card .text-danger { color: #b42318; }
.day-mini-stat .mini-value.text-success,
.day-card .text-success { color: #027a48; }

@media (max-width: 380px) {
    .day-card { padding: 12px; }
    .day-card-top {
        grid-template-columns: 1fr 1fr;
    }
    .day-card-date {
        grid-column: 1 / -1;
    }
    .day-card-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .day-mini-stat .mini-value { font-size: 16px; }
}

@media (min-width: 720px) {
    .day-card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phase 2.5 - status colours for incentive day cards and entry fields */
.day-card.day-card-holiday {
    background: #fff5f5;
    border-color: #fecaca;
}

.day-card.day-card-pa {
    background: #fff7ed;
    border-color: #fed7aa;
}

.day-card.day-card-idle {
    background: #fefce8;
    border-color: #fde68a;
}

.day-card-date-alert,
.day-pill-alert {
    color: #b42318 !important;
}

.day-pill-alert {
    background: #fee2e2;
}

.day-pill-shift {
    border: 1px solid transparent;
}

.shift-pill-day {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}

.shift-pill-night {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.day-pill-idle {
    background: #fef9c3;
    color: #854d0e;
}

input[readonly][data-zero-earned="1"] {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.badge-warning {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fef9c3;
    color: #854d0e;
    font-size: 12px;
    font-weight: 900;
}

/* Phase 2.7 multiple coach/work-line entry */
.daily-entry-card-list {
    display: grid;
    gap: 14px;
}
.daily-entry-card {
    border: 1px solid #d8e0ec;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    padding: 16px;
}
.daily-entry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.daily-entry-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.readonly-pill {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 14px;
    background: #f4f7fb;
    font-weight: 800;
    color: #1e293b;
}
.work-lines-wrap {
    border-top: 1px dashed #dbe3ef;
    padding-top: 12px;
}
.work-lines {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}
.work-line {
    display: grid;
    grid-template-columns: minmax(130px, 180px) 1fr minmax(92px, 110px) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.sticky-save-bar {
    position: sticky;
    bottom: 8px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 10px;
    z-index: 10;
}
.employee-work-lines {
    display: grid;
    gap: 8px;
}
.employee-work-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.employee-work-line strong {
    white-space: nowrap;
    color: #1d4ed8;
}
@media (max-width: 760px) {
    .daily-entry-card {
        border-radius: 20px;
        padding: 14px;
    }
    .daily-entry-head {
        flex-direction: column;
    }
    .daily-entry-head .copy-box {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto;
    }
    .daily-entry-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .work-line {
        grid-template-columns: 1fr;
    }
    .work-line .btn {
        width: 100%;
    }
}

/* Phase 2.8 - daily consolidated allotted work view */
.daily-work-view-list {
    display: grid;
    gap: 12px;
}
.daily-work-view-card {
    border: 1px solid #dbe3ef;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    padding: 16px;
}
.daily-work-view-top,
.daily-work-view-bottom {
    display: grid;
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
.daily-work-view-work {
    margin: 12px 0;
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.token-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.token-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 900;
}
.earned-total-box {
    justify-self: end;
    min-width: 90px;
    text-align: right;
    padding: 8px 10px;
    border-radius: 14px;
    background: #ecfdf3;
    color: #027a48;
}
.earned-total-box strong { font-size: 18px; }
@media (max-width: 640px) {
    .daily-work-view-card { padding: 14px; border-radius: 20px; }
    .daily-work-view-top,
    .daily-work-view-bottom {
        grid-template-columns: 1fr;
    }
    .earned-total-box {
        justify-self: stretch;
        text-align: left;
    }
}

/* Phase 2.9 - one-day consolidated daily work card */
.daily-work-day-card {
    border: 1px solid #dbe3ef;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    padding: 18px;
    margin-bottom: 18px;
}
.daily-work-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 18px;
}
.daily-work-day-head span {
    font-weight: 900;
    color: #475569;
}
.daily-work-status-lines,
.daily-work-consolidated-lines {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}
.daily-work-status-row,
.daily-work-line-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}
.daily-work-status-row.status-pa {
    background: #fff7ed;
    border-color: #fed7aa;
}
.daily-work-status-row.status-idle,
.daily-work-line-row.special-work-line {
    background: #fefce8;
    border-color: #fde68a;
}
.daily-work-line-row {
    background: #f8fafc;
}
.compact-token-chip-list {
    margin-top: 0;
}
@media (min-width: 720px) {
    .daily-work-status-row,
    .daily-work-line-row {
        grid-template-columns: 250px minmax(0, 1fr);
        align-items: center;
    }
}

/* Phase 2.10 - Android app style shell + month pagination */
body {
    background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 28%, #ffffff 100%);
}
.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.90) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1d4ed8;
    color: #ffffff;
    font-weight: 1000;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.24);
    flex: 0 0 auto;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.navtabs {
    position: sticky;
    top: 68px;
    z-index: 25;
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(12px);
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid #e2e8f0;
}
.navtabs::-webkit-scrollbar { display: none; }
.navtabs a {
    white-space: nowrap;
    border-radius: 999px !important;
    padding: 10px 14px !important;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.container {
    max-width: 980px;
}
.card,
.daily-work-day-card,
.day-card,
.daily-entry-card,
.stat {
    border-radius: 24px !important;
}
.card {
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07) !important;
}
.app-title-card {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%) !important;
}
.compact-filter-card {
    padding: 14px !important;
}
.month-title-pill {
    margin: 12px 0 16px;
    padding: 14px 16px;
    border-radius: 22px;
    background: #111827;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.16);
}
.month-title-pill span {
    color: #dbeafe;
    font-weight: 800;
}
.daily-month-list {
    display: grid;
    gap: 14px;
}
.daily-work-day-card {
    margin-bottom: 0;
}
.daily-work-day-head {
    position: relative;
}
.daily-work-sunday-card {
    background: #fff5f5 !important;
    border-color: #fecaca !important;
}
.daily-work-sunday-card .daily-work-day-head {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #b42318;
}
.daily-work-empty-card {
    opacity: 0.82;
}
.empty-day-note {
    padding: 12px 14px;
    margin-top: 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}
.month-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin: 18px 0 8px;
    padding: 12px;
    border-radius: 22px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}
.month-pagination a:first-child,
.month-pagination .btn-disabled:first-child { justify-self: start; }
.month-pagination a:last-child,
.month-pagination .btn-disabled:last-child { justify-self: end; }
.month-pagination-current {
    font-weight: 1000;
    color: #0f172a;
    text-align: center;
    white-space: nowrap;
}
.btn-disabled {
    opacity: 0.45;
    pointer-events: none;
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
}
.btn-small {
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-height: 34px !important;
}
@media (max-width: 720px) {
    .app-header {
        align-items: flex-start !important;
        gap: 10px;
        padding: 10px 12px !important;
    }
    .brand-icon { width: 38px; height: 38px; border-radius: 14px; }
    .brand { font-size: 15px !important; line-height: 1.2; }
    .subbrand { font-size: 11px !important; }
    .topbar-actions { width: 100%; justify-content: space-between; }
    .topbar-actions .btn { flex: 1; text-align: center; padding: 9px 10px !important; }
    .navtabs { top: 96px; padding: 8px 10px !important; }
    .container { padding: 12px !important; }
    .card { padding: 14px !important; margin-bottom: 12px !important; }
    .card h1 { font-size: 21px !important; }
    .card h2 { font-size: 17px !important; }
    .month-title-pill {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 20px;
        padding: 13px 14px;
    }
    .daily-work-day-card { padding: 12px !important; border-radius: 22px !important; }
    .daily-work-day-head {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        font-size: 16px;
    }
    .daily-work-day-head .btn-small {
        grid-column: 1 / -1;
        width: 100%;
    }
    .daily-work-status-row,
    .daily-work-line-row {
        padding: 11px 12px;
        border-radius: 16px;
    }
    .month-pagination {
        grid-template-columns: 1fr 1fr;
    }
    .month-pagination-current {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: 4px;
    }
    .month-pagination a,
    .month-pagination .btn-disabled {
        width: 100%;
        text-align: center;
        justify-self: stretch !important;
    }
}

/* Phase 2.11 - compact daily allotted works search view */
.daily-work-search-form {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.daily-work-search-actions {
    margin-top: 0;
    align-items: end;
}
.compact-daily-month-list {
    gap: 10px;
}
.compact-day-card {
    padding: 12px !important;
    border-radius: 20px !important;
}
.compact-date-head {
    padding: 10px 12px !important;
    border-radius: 16px !important;
    font-size: 16px !important;
}
.compact-date-head > div {
    min-width: 0;
}
.daily-work-lines-plain {
    display: grid;
    gap: 0;
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
}
.daily-work-plain-line {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    font-size: 15px;
    line-height: 1.35;
    word-break: break-word;
}
.daily-work-plain-line:last-child {
    border-bottom: 0;
}
.daily-work-plain-line strong {
    color: #0f172a;
}
.daily-work-plain-line span {
    color: #334155;
    font-weight: 700;
}
.daily-work-plain-line.status-pa {
    background: #fff7ed;
}
.daily-work-plain-line.status-idle,
.daily-work-plain-line.special-work-line {
    background: #fefce8;
}
@media (max-width: 720px) {
    .daily-work-search-form {
        grid-template-columns: 1fr;
    }
    .daily-work-search-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
    .compact-date-head {
        grid-template-columns: 1fr auto !important;
    }
    .daily-work-plain-line {
        font-size: 14px;
        padding: 9px 10px;
    }
}

/* Phase 2.13 master admin / limited admin permissions */
.permission-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfdff;
    margin: 0;
}
.check-card input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}
.check-card span {
    font-weight: 800;
}
.admin-user-list {
    display: grid;
    gap: 12px;
}
.admin-user-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    background: #fff;
}
.admin-user-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.permission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
@media (min-width: 720px) {
    .permission-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .permission-grid { grid-template-columns: repeat(3, 1fr); }
}
