*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6f8;
    color: #1c2430;
    font-size: 17px;
    line-height: 1.5;
}

/* Passcode Screen */
.passcode-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.passcode-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 390px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid #e2e8f0;
}

.passcode-brand {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5a6a80;
    margin-bottom: 6px;
}

.passcode-heading {
    margin: 0 0 20px 0;
    font-size: 2.1rem;
    font-weight: 800;
    color: #111827;
}

.passcode-input {
    width: 100%;
    font-size: 2rem;
    letter-spacing: 0.35em;
    text-align: center;
    padding: 12px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    margin-bottom: 16px;
    outline: none;
    background: #f8fafc;
}

.passcode-input:focus {
    border-color: #2563eb;
    background: #ffffff;
}

.passcode-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.keypad-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #1e293b;
    padding: 16px 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.keypad-btn:hover {
    background: #e2e8f0;
}

.keypad-btn:active {
    background: #cbd5e1;
}

.keypad-alt {
    font-size: 1.05rem;
    color: #475569;
}

.btn-enter-code {
    width: 100%;
    padding: 14px;
    font-size: 1.15rem;
}

/* Main App Container */
.app-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 60px 16px;
}

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

.brand-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
}

.role-pill {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-top: 4px;
}

.manager-pill {
    background: #dcfce7;
    color: #166534;
}

.owner-pill {
    background: #dbeafe;
    color: #1e40af;
}

/* Tabs */
.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.tab-btn:hover {
    background: #f8fafc;
}

.tab-btn.active {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #ffffff;
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

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

.section-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

/* Notice Banner */
.notice-banner {
    background: #eff6ff;
    border: 2px solid #93c5fd;
    color: #1e3a8a;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.btn-close-notice {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #1e3a8a;
    font-weight: 700;
}

/* Punch Card */
.punch-card {
    border-width: 2px;
}

.punch-active {
    border-color: #22c55e;
    background: #f0fdf4;
}

.punch-inactive {
    border-color: #cbd5e1;
    background: #ffffff;
}

.punch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.punch-label {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #64748b;
}

.punch-status-text {
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.green-dot {
    background: #16a34a;
}

.gray-dot {
    background: #94a3b8;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.92rem;
}

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

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #334155;
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-danger-outline {
    background: #ffffff;
    border: 2px solid #fca5a5;
    color: #b91c1c;
}

.btn-danger-outline:hover {
    background: #fef2f2;
}

.btn-punch-in {
    background: #16a34a;
    color: #ffffff;
    font-size: 1.25rem;
    padding: 16px 32px;
    border-radius: 12px;
}

.btn-punch-in:hover {
    background: #15803d;
}

.btn-punch-out {
    background: #dc2626;
    color: #ffffff;
    font-size: 1.25rem;
    padding: 16px 32px;
    border-radius: 12px;
}

.btn-punch-out:hover {
    background: #b91c1c;
}

.btn-start {
    background: #2563eb;
    color: #ffffff;
    padding: 12px 20px;
    font-size: 1.05rem;
}

.btn-start:hover {
    background: #1d4ed8;
}

.btn-pause {
    background: #d97706;
    color: #ffffff;
    padding: 12px 20px;
    font-size: 1.05rem;
}

.btn-pause:hover {
    background: #b45309;
}

.btn-complete {
    background: #16a34a;
    color: #ffffff;
    padding: 12px 22px;
    font-size: 1.05rem;
}

.btn-complete:hover {
    background: #15803d;
}

/* Task Rows */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.task-row-active {
    border-color: #2563eb;
    background: #eff6ff;
}

.task-row-paused {
    border-color: #f59e0b;
    background: #fffbeb;
}

.task-info {
    flex: 1;
    min-width: 240px;
}

.task-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #475569;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Badges */
.status-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.tag-working {
    background: #dbeafe;
    color: #1e40af;
}

.tag-paused {
    background: #fef3c7;
    color: #92400e;
}

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-recurring {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-onetime {
    background: #f1f5f9;
    color: #475569;
}

/* Forms */
.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fg-wide {
    flex: 1;
    min-width: 260px;
}

.form-group label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #334155;
}

.input-box {
    padding: 12px 14px;
    font-size: 1.02rem;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
}

.input-box:focus {
    outline: none;
    border-color: #2563eb;
}

.number-short {
    width: 90px;
}

.select-short {
    width: 110px;
}

.select-medium {
    width: 170px;
}

.form-actions-end {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

/* Recurring Schedule Picker */
.schedule-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.choice-card {
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
}

.choice-card:hover {
    background: #f1f5f9;
}

.choice-card.selected {
    background: #eff6ff;
    border-color: #2563eb;
}

.choice-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 0.98rem;
}

.choice-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

.schedule-builder-box {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
}

.inline-schedule-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 600;
}

.schedule-preview-bar {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #cbd5e1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #1e3a8a;
}

.next-date-pill {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Completed Tasks & Reports */
.completed-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    background: #ffffff;
}

.completed-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.completed-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.duration-box {
    text-align: right;
}

.duration-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
}

.duration-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.duration-highlight {
    background: #dcfce7;
    color: #166534;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 800;
}

.correction-details {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #78350f;
}

.correction-form-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px dashed #cbd5e1;
}

.correction-form-panel h4 {
    margin: 0 0 6px 0;
}

.correction-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.error-text {
    color: #b91c1c;
    font-weight: 700;
    margin-top: 8px;
}

/* Tables */
.simple-table-wrap {
    overflow-x: auto;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.simple-table th,
.simple-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.simple-table th {
    background: #f8fafc;
    font-weight: 800;
    color: #475569;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.total-hours-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
}

.punch-summary-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 28px 16px;
    color: #64748b;
}

.empty-check {
    font-size: 2.5rem;
    color: #16a34a;
    margin-bottom: 6px;
}

.muted-text {
    color: #64748b;
}

.muted-small {
    font-size: 0.85rem;
    color: #64748b;
}
