:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2937;
    background: #f5f7fa;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
}

a { color: inherit; }

.topbar {
    min-height: 64px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.brand {
    font-weight: 750;
    font-size: 1.1rem;
    text-decoration: none;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar nav a,
.link-button {
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    color: #4b5563;
    padding: 0;
}

.inline-form { display: inline; }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 24px;
}

h1 { margin-top: 0; font-size: 2rem; }
h2 { margin-top: 0; font-size: 1.15rem; }

.muted { color: #6b7280; }
.lead { font-size: 1.15rem; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.035);
}

.login-wrap {
    min-height: calc(100vh - 145px);
    display: grid;
    place-items: center;
}

.login-card { width: min(420px, 100%); }

label {
    display: block;
    font-weight: 600;
    margin: 18px 0 7px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font: inherit;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 400;
}

.primary-button {
    display: inline-block;
    width: 100%;
    margin-top: 18px;
    border: 0;
    border-radius: 9px;
    padding: 12px 16px;
    background: #111827;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button-link {
    width: auto;
    text-decoration: none;
}

.flash {
    padding: 12px 15px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
}

.flash.error { border-color: #fecaca; }
.flash.info { border-color: #bfdbfe; }

.badge {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: .82rem;
}

.technical {
    margin-top: 24px;
    color: #64748b;
}

@media (max-width: 640px) {
    .topbar { padding: 0 16px; }
    .topbar nav { gap: 12px; font-size: .9rem; }
    .container { padding: 24px 16px; }
}

.secondary-button {
    display: inline-block;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 10px 14px;
    background: #fff;
    color: #1f2937;
    font-weight: 650;
    text-decoration: none;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.workplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.workplace-card { margin: 0; }

.workplace-button {
    width: 100%;
    min-height: 170px;
    text-align: left;
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    padding: 22px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font: inherit;
    color: inherit;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.035);
}

.workplace-button:hover { border-color: #94a3b8; }
.workplace-button strong { font-size: 1.2rem; }
.workplace-customer { color: #64748b; font-size: .92rem; }

@media (max-width: 640px) {
    .page-heading { display: block; }
    .page-heading .secondary-button { margin-top: 12px; }
}


.flash.success { border-color: #bbf7d0; }
.flash.warning { border-color: #fde68a; }
.field-error { color: #b91c1c; margin-top: 5px; font-size: .9rem; }

.clock-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 20px;
    text-align: center;
}

.clock-card.active {
    border-color: #cbd5e1;
}

.clock-status {
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .82rem;
    font-weight: 700;
}

.clock-card h2 {
    font-size: 1.55rem;
    margin: 8px 0;
}

.clock-time {
    color: #475569;
    margin-bottom: 24px;
}

.clock-button {
    width: min(440px, 100%);
    min-height: 92px;
    border: 0;
    border-radius: 15px;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
    background: #111827;
    color: #fff;
}

.forgotten-card {
    margin-bottom: 20px;
}

.forgotten-card summary {
    cursor: pointer;
    font-weight: 700;
}

.manual-form {
    margin-top: 20px;
}

.manual-form input[type="datetime-local"],
.manual-form textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font: inherit;
}

.overnight-note p {
    margin-bottom: 0;
}

.admin-section {
    margin-bottom: 20px;
}

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

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

th,
td {
    text-align: left;
    padding: 11px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

th {
    font-size: .84rem;
    color: #64748b;
}

.actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.small-button {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    cursor: pointer;
    background: #111827;
    color: #fff;
}

.small-button.secondary {
    background: #fff;
    color: #1f2937;
    border: 1px solid #cbd5e1;
}


.flash {
    font-weight: 500;
}

.flash.error {
    background: #fff1f2;
    border: 2px solid #e11d48;
    color: #881337;
}

.flash.warning {
    background: #fffbeb;
    border: 2px solid #d97706;
    color: #78350f;
}

.flash.success {
    background: #f0fdf4;
    border: 2px solid #16a34a;
    color: #14532d;
}

.important-message strong {
    display: block;
    margin-bottom: 4px;
}

.validation-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 17px 18px;
    margin-bottom: 20px;
    border: 2px solid #dc2626;
    border-radius: 12px;
    background: #fef2f2;
    color: #7f1d1d;
}

.validation-banner p {
    margin: 4px 0 0;
}

.validation-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #dc2626;
    color: #fff;
    font-weight: 800;
}

.has-validation-error {
    border: 2px solid #dc2626;
}

.inline-error {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #fef2f2;
    color: #991b1b;
    font-weight: 700;
}

.input-error {
    border: 2px solid #dc2626 !important;
    background: #fffafa;
}

.audit-detail {
    margin-top: 4px;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.4;
}


.topbar-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.admin-quick-clock {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 18px;
    border-right: 1px solid #e5e7eb;
    font-size: .82rem;
    color: #64748b;
}

.quick-clock-status {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.quick-dot.active {
    background: #16a34a;
}

.quick-clock-button {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 5px 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
}

.quick-clock-button:hover {
    background: #f8fafc;
}

.quick-clock-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 650;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.table-action-link {
    display: inline-block;
    padding: 6px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 650;
    white-space: nowrap;
}

.form-card {
    max-width: 720px;
}

.form-card select,
.form-card input[type="datetime-local"],
.form-card textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    font: inherit;
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(150px, .65fr) minmax(240px, 1fr);
    gap: 18px;
}

.form-help {
    margin: 18px 0 0;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.5;
}

.audit-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.audit-summary > div {
    min-width: 190px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.audit-summary strong {
    display: block;
    margin-top: 3px;
}

.audit-label {
    color: #64748b;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

@media (max-width: 800px) {
    .topbar-right {
        gap: 12px;
    }

    .admin-quick-clock {
        padding-right: 10px;
    }

    .quick-clock-status {
        max-width: 110px;
    }
}

@media (max-width: 640px) {
    .admin-quick-clock {
        border-right: 0;
        padding-right: 0;
    }

    .quick-clock-status {
        display: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
