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

:root {
    --bg: #f3efe6;
    --surface: #ffffff;
    --ink: #122423;
    --muted: #5b6c6b;
    --line: #e2d9cb;
    --accent: #ef8a17;
    --accent-dark: #c06b0f;
    --accent-2: #0f7b6c;
    --accent-3: #f6d57c;
    --shadow: 0 20px 45px rgba(18, 36, 35, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top, #ffffff 0%, #f6f1e7 35%, #efe7da 100%);
    min-height: 100vh;
}

.mobile-body {
    background: #f5f7fb;
}

.mobile-body .site-header {
    display: none;
}

.mobile-body .ambient {
    display: none;
}

.mobile-body .page {
    max-width: 460px;
    padding: 18px 18px 120px;
}

h1, h2, h3 {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    margin: 0 0 12px;
}

p {
    margin: 0 0 12px;
}

a {
    color: inherit;
    text-decoration: none;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 999px;
    opacity: 0.45;
    filter: blur(0px);
    animation: float 10s ease-in-out infinite;
}

.shape-one {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, #f7c872, #ef8a17);
    top: -60px;
    right: -60px;
}

.shape-two {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, #8edac7, #0f7b6c);
    bottom: -120px;
    left: -80px;
    animation-delay: 1.5s;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
    animation: fadeUp 0.6s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--accent-2);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-title {
    font-weight: 700;
    margin: 0;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.site-nav a {
    font-weight: 600;
    white-space: nowrap;
}

.link-muted {
    color: var(--muted);
    font-weight: 500;
}

.link-danger {
    color: #b23b2a;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
}

.mobile-menu {
    display: none;
    position: relative;
}

.mobile-menu summary {
    list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
    display: none;
}

.mobile-menu-button {
    padding: 8px 14px;
    font-size: 0.9rem;
}

.mobile-menu-panel {
    position: absolute;
    right: 0;
    top: 48px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 10px;
    min-width: 220px;
    display: grid;
    gap: 6px;
    z-index: 20;
}

.mobile-menu-panel a {
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.mobile-menu-panel a:hover {
    background: #f3f4f7;
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 18px;
}

.brand-vertical {
    flex-direction: column;
    align-items: flex-start;
}

.admin-nav {
    display: grid;
    gap: 10px;
}

.admin-nav a {
    font-weight: 600;
    color: var(--ink);
    padding: 8px 10px;
    border-radius: 12px;
    background: transparent;
}

.admin-nav a:hover {
    background: #f3f1ea;
}

.admin-main .content {
    margin-top: 0;
}

.admin-top {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.admin-menu {
    position: relative;
}

.admin-menu summary {
    list-style: none;
}

.admin-menu summary::-webkit-details-marker {
    display: none;
}

.admin-menu-button {
    padding: 8px 14px;
    font-size: 0.9rem;
}

.admin-menu-panel {
    position: absolute;
    right: 0;
    top: 48px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 10px;
    min-width: 220px;
    display: grid;
    gap: 6px;
    z-index: 30;
}

.admin-menu-panel a {
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.admin-menu-panel a:hover {
    background: #f3f4f7;
}

.content {
    display: grid;
    gap: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.75rem;
    color: var(--accent-2);
    margin-bottom: 8px;
    font-weight: 600;
}

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

.button {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(18, 36, 35, 0.15);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.button-primary {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}

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

.card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.6s ease;
}

.mobile-shell {
    display: grid;
    gap: 18px;
}

.mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
}

.logo-mark {
    color: #1e2a3b;
}

.logo-dot {
    color: #4e6cff;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #e7ecf5;
    color: #1e2a3b;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.user-menu {
    position: relative;
}

.user-menu summary {
    list-style: none;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.menu-card {
    position: absolute;
    right: 0;
    top: 48px;
    background: #ffffff;
    border: 1px solid #e4e9f3;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(20, 30, 60, 0.16);
    padding: 10px;
    min-width: 140px;
    display: grid;
    gap: 6px;
    z-index: 20;
}

.menu-card a {
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600;
    color: #27344f;
}

.menu-card a:hover {
    background: #f1f4fa;
}

.menu-danger {
    color: #d23b2d;
}

.mobile-greeting h1 {
    font-size: 1.45rem;
}

.hero-card {
    background: linear-gradient(120deg, #dbe7ff, #f3f7ff);
    border-radius: 22px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border: 1px solid #d4def5;
    flex-wrap: wrap;
}

.announcement-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    border: 1px solid #e4e9f3;
    display: grid;
    gap: 6px;
}

.finger-form {
    display: grid;
    gap: 18px;
}

.hero-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    color: #3e5070;
    margin-bottom: 6px;
    font-weight: 600;
}

.mobile-section {
    display: grid;
    gap: 12px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h2 {
    font-size: 1.05rem;
}

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

.feature-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 14px;
    border: 1px solid #e4e9f3;
    display: grid;
    gap: 8px;
}

.feature-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    color: #5a6a82;
    font-weight: 600;
}

.feature-value {
    font-weight: 600;
}

.clock {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e2a3b;
}

.selfie-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 14px;
    border: 1px solid #e4e9f3;
    display: grid;
    gap: 12px;
}

.selfie-preview {
    border-radius: 14px;
    background: #f1f4fa;
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: #5a6a82;
    position: relative;
    min-height: 180px;
}

.selfie-preview img,
.selfie-preview video {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.selfie-preview video {
    display: none;
}

.selfie-preview video.is-active {
    display: block;
}

.selfie-placeholder {
    position: absolute;
    inset: 12px;
    display: grid;
    place-items: center;
    color: #5a6a82;
}

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

.notif-list {
    display: grid;
    gap: 10px;
}

.notif-item {
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid #e4e9f3;
    font-size: 0.9rem;
    color: #3e4c63;
}

.notif-ok {
    border-color: #c7ead7;
    background: #e9f7ef;
    color: #1d6f4b;
}

.notif-warn {
    border-color: #f4c2b8;
    background: #ffe8e5;
    color: #9a2e1f;
}

.notif-info {
    border-color: #d9e3f6;
    background: #eef3ff;
    color: #3e4c63;
}

.finger-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(10, 15, 25, 0.3);
    z-index: 45;
}

.finger-modal.is-open {
    display: flex;
}

.finger-modal-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e4e9f3;
    box-shadow: 0 18px 40px rgba(20, 30, 60, 0.2);
    padding: 16px;
    width: min(540px, calc(100% - 32px));
    margin: 16px;
    display: grid;
    gap: 14px;
}

.finger-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.finger-modal-header h3 {
    margin: 0;
    font-size: 1rem;
}

.finger-modal-actions {
    display: grid;
    gap: 10px;
}

.status-popup {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(10, 15, 25, 0.3);
    z-index: 50;
}

.status-popup.is-open {
    display: flex;
}

.status-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e4e9f3;
    box-shadow: 0 16px 40px rgba(20, 30, 60, 0.2);
    padding: 16px;
    width: min(420px, calc(100% - 32px));
    margin: 16px;
}

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

.status-header h3 {
    margin: 0;
    font-size: 1rem;
}

.status-close {
    border: none;
    background: none;
    color: #5a6a82;
    font-weight: 600;
    cursor: pointer;
}

.status-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.status-list li {
    background: #f6f8fc;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.9rem;
    border: 1px solid #e4e9f3;
}

.status-list li.notif-ok {
    border-color: #c7ead7;
    background: #e9f7ef;
    color: #1d6f4b;
}

.status-list li.notif-warn {
    border-color: #f4c2b8;
    background: #ffe8e5;
    color: #9a2e1f;
}

.status-list li.notif-info {
    border-color: #d9e3f6;
    background: #eef3ff;
    color: #3e4c63;
}

.history-list {
    display: grid;
    gap: 12px;
}

.history-item {
    background: #ffffff;
    border: 1px solid #e4e9f3;
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.history-time {
    font-weight: 600;
    margin: 0 0 4px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    width: min(420px, calc(100% - 32px));
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e4e9f3;
    box-shadow: 0 12px 30px rgba(20, 30, 60, 0.16);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
    gap: 6px;
    z-index: 10;
}

.nav-item {
    display: grid;
    justify-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #5a6a82;
    font-weight: 600;
}

.nav-item.active {
    color: #2f4be6;
}

.finger-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.finger-button {
    font-size: 1.1rem;
    padding: 14px 28px;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

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

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

.stat-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.6s ease;
}

.stat-label {
    color: var(--muted);
    margin-bottom: 6px;
}

.muted {
    color: var(--muted);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.pager {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.pagination {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    font-weight: 600;
    min-width: 36px;
}

.pagination li a:hover {
    background: #f3f1ea;
}

.pagination li.active span {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    font-size: 0.85rem;
}

.report-table th,
.report-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.report-name {
    font-weight: 600;
    white-space: nowrap;
}

.report-time {
    display: grid;
    gap: 4px;
    font-size: 0.8rem;
}

.status-late {
    color: #b23b2a;
    font-weight: 600;
}

.status-ot {
    color: #0f7b6c;
    font-weight: 600;
}

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

th, td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
}

th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--muted);
}

.table-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.flash-card {
    background: #fff3dd;
    border: 1px solid #f4d8a6;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.alert-error {
    background: #ffe8e5;
    border: 1px solid #f4b3a9;
    color: #8b2a1d;
}

.pill {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e4f4ef;
    color: #0f7b6c;
    font-size: 0.75rem;
    font-weight: 700;
}

form {
    display: grid;
    gap: 16px;
}

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

.schedule-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 8px;
}

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

textarea {
    resize: vertical;
}

.login {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: center;
}

.login-hero {
    animation: fadeUp 0.6s ease;
}

.login-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 22px;
    border: 1px solid var(--line);
    padding: 26px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.6s ease 0.1s;
}

.feature-list {
    padding-left: 18px;
    color: var(--muted);
}

.chip {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.hint {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--muted);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(14px);
    }
}

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

@media (max-width: 900px) {
    .page {
        padding: 20px 16px 48px;
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        display: none;
    }

    .mobile-menu {
        display: block;
        align-self: flex-end;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-top {
        display: flex;
    }

    .table-stack thead {
        display: none;
    }

    .table-stack tr {
        display: block;
        border: 1px solid var(--line);
        border-radius: 16px;
        padding: 12px;
        margin-bottom: 12px;
        background: rgba(255, 255, 255, 0.96);
    }

    .table-stack td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px dashed var(--line);
    }

    .table-stack td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
    }

    .table-stack td:last-child {
        border-bottom: none;
    }

    .table-stack td[colspan] {
        justify-content: center;
    }

    .table-stack td[colspan]::before {
        content: none;
    }

    .table-stack td.table-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .login {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .actions {
        width: 100%;
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .finger-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .bottom-nav {
        width: calc(100% - 24px);
    }
}
