* {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: url("/static/dahai.jpg") center/cover no-repeat fixed;
    color: #000000;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body::after {
    content: "";
    position: fixed;
    z-index: 0;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    filter: blur(24px);
    opacity: 0.35;
    pointer-events: none;
}

body::after {
    bottom: -140px;
    right: -140px;
    background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 0;
    pointer-events: none;
}

body.auth-page::before {
    background: transparent;
}

body.app-shell-page::before {
    background: transparent;
}

body.app-shell-page::after {
    opacity: 0;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.88);
    color: #111827;
    border-bottom: 1px solid #dbeafe;
    backdrop-filter: blur(8px);
}

.brand h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: 0.5px;
}

.brand p {
    margin: 3px 0 0;
    font-size: 12px;
    color: #6366f1;
}

.user-badge {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
}

.site-header h1 {
    margin: 0;
    font-size: 22px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.container {
    max-width: 1320px;
    margin: 28px auto;
    padding: 0 18px 24px;
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
}

.site-footer {
    position: relative;
    z-index: 1;
    padding: 18px 12px 22px;
    text-align: center;
}

.site-footer-text {
    font-size: 12px;
    color: #000000;
}

body.app-shell-page .container {
    max-width: 1460px;
}

:root {
    --shell-panel-bg: rgba(255, 255, 255, 0.68);
    --shell-radius: 14px;
    --accent: #1f7a77;
    --accent-hover-bg: rgba(31, 122, 119, 0.22);
    --control-height: 44px;
    --control-font-size: 14px;
    --control-radius: 8px;
}

body.app-shell-page .admin-main > .card:not(.admin-panel) {
    background: var(--shell-panel-bg);
}

body.app-shell-page .admin-main > .card.admin-panel {
    background: transparent;
}

.card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #dbeafe;
    border-radius: var(--shell-radius);
    padding: 20px;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.08);
    margin-bottom: 20px;
}

.admin-panel.card {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    padding: 0;
}

.card h2 {
    margin-top: 0;
}

.auth-card {
    width: 400px;
    max-width: 100%;
    text-align: center;
    padding: 24px 28px 20px;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(45, 55, 72, 0.12);
}

.auth-page .site-header {
    display: none;
}

.auth-page .header-right {
    display: none;
}

.auth-page .container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

/* ===== Login page monochrome spec ===== */
body.auth-page {
    background: url("/static/dahai.jpg") center/cover no-repeat fixed;
}

body.auth-page .auth-card {
    width: 400px;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(6px);
}

.auth-page .flash-wrap {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 460px);
    z-index: 20;
    margin-bottom: 0;
}

body.auth-page .login-title {
    font-size: 26px;
    margin-bottom: 10px;
}

body.auth-page .login-subtitle {
    display: none;
}

.hint {
    color: #000000;
}

::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.form-grid {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 14px;
    align-items: center;
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

label {
    font-weight: 600;
    color: #000000;
}

input,
button,
select {
    height: var(--control-height);
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--control-radius);
    font-size: var(--control-font-size);
    line-height: 1;
}

input,
select {
    background: #ffffff;
    color: #000000;
    transition: all 0.2s ease;
}


input:focus,
select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button {
    border: none;
    background: #4b9a97;
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    background: #3d8683;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

body.app-shell-page button,
body.app-shell-page .btn-secondary,
body.app-shell-page .btn-danger {
    background: #1f7a77;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
}

body.app-shell-page button:hover,
body.app-shell-page .btn-secondary:hover,
body.app-shell-page .btn-danger:hover {
    background: #176563;
}

button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-secondary {
    background: #4b9a97;
}

.btn-danger {
    background: #4b9a97;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.stack-form .actions {
    margin-top: 0;
}

.segment-row {
    display: grid;
    grid-template-columns: 120px 28px 120px 1fr 80px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.flash-wrap {
    margin-bottom: 12px;
}

.flash {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.flash.success {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.flash.error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 10px;
}

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 10px;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f1f5f9;
    color: #000000;
    font-weight: 700;
}

tbody tr:hover td {
    background: var(--accent-hover-bg);
}

tbody tr:hover td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

tbody tr:hover td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
}

.filter-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-item-date .date-range input[type="date"] {
    min-width: 140px;
}

.filter-group-date {
    gap: 10px;
}

.date-range {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.date-sep {
    color: #000000;
    font-size: 13px;
}

.filter-row input[type="date"] {
    min-width: 170px;
    height: var(--control-height);
    padding: 0 12px;
    border-radius: var(--control-radius);
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-height);
    padding: 0 18px;
    background: #1f7a77;
    color: #fff;
    border-radius: var(--control-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--control-font-size);
    line-height: var(--control-height);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-link:hover {
    background: #176563;
    transform: translateY(-1px);
}

button.btn-link {
    border: none;
    cursor: pointer;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat-box {
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 14px;
    background: #f8fbff;
}

.stat-title {
    color: #000000;
    font-size: 13px;
}

.stat-value {
    font-size: 24px;
    margin-top: 6px;
    font-weight: 700;
}

.user-manage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.user-manage-grid > div {
    display: flex;
    flex-direction: column;
}

.stack-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.stack-form input,
.stack-form select,
.stack-form button,
.stack-form .btn-link {
    width: 100%;
    height: 44px;
}

.stack-form .checkbox-row {
    min-height: 28px;
}

.stack-form .actions button {
    width: auto;
    flex: 1;
}

.vbars {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    padding: 10px 4px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(31, 122, 119, 0.55) transparent;
}

.vbars::-webkit-scrollbar {
    height: 8px;
}

.vbars::-webkit-scrollbar-track {
    background: transparent;
}

.vbars::-webkit-scrollbar-thumb {
    background: rgba(31, 122, 119, 0.45);
    border-radius: 999px;
}

.vbars::-webkit-scrollbar-thumb:hover {
    background: rgba(31, 122, 119, 0.65);
}

.vbar {
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.vbar-value {
    font-weight: 700;
    color: #111827;
    font-size: 12px;
    white-space: nowrap;
}

.vbar-track {
    width: 100%;
    height: 160px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    border: none;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.vbar-fill {
    width: 100%;
    background: #1f7a77;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.vbar-label {
    width: 100%;
    text-align: center;
    font-weight: 600;
    color: #111827;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .vbar-track {
        height: 140px;
    }
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
}

.total-hours-box {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
}

.total-hours-box strong {
    color: #000000;
    font-size: 18px;
}

.total-hours-inline {
    margin-top: 6px;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 6px;
}

.total-hours-inline strong {
    color: #000000;
    font-size: 18px;
    font-weight: 800;
}

.total-hours-inline #total-hours-text {
    font-size: 18px;
    font-weight: 400;
}

.center-title {
    text-align: center;
}

.field-block {
    margin-bottom: 8px;
}

body.app-shell-page .field-block select,
body.app-shell-page .field-block input[type="date"] {
    width: 140px;
    max-width: 100%;
}

.form-section-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.full-btn {
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #222222;
}

.login-subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    color: #666666;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 6px;
    border: 1px solid #dddddd;
    background: #ffffff;
    transition: border-color 0.2s ease;
    margin-bottom: 16px;
}

.input-group input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 15px 0 40px;
    height: 44px;
    font-size: 14px;
    color: #4a5568;
}

body.auth-page .input-group input {
    padding: 0 15px 0 40px;
    text-align: left;
    color: #222222;
}

body.auth-page .input-icon {
    display: inline-flex;
}

.input-group:focus-within {
    border-color: #222222;
}

.input-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: #999999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.login-label {
    display: block;
    text-align: left;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.72);
    margin: 0 0 6px;
}

.full-btn {
    width: 100%;
    height: 44px;
    border-radius: 6px;
    font-weight: 700;
    background: #1f7a77;
    color: #ffffff;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
}

.full-btn:hover {
    background: #176563;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.22);
}

.admin-layout {
    position: relative;
    display: block;
}

.admin-sidebar {
    width: 120px;
    position: absolute;
    left: 0;
    top: 0;
    margin-top: 0;
    z-index: 5;
}

.admin-main {
    width: min(1120px, 100%);
    margin: 0 auto;
    min-width: 0;
}

.sidebar-item {
    display: flex;
    width: 100%;
    text-align: left;
    height: 44px;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(219, 234, 254, 1);
    background: rgba(255, 255, 255, 0.55);
    color: rgba(15, 23, 42, 1);
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sidebar-link {
    text-decoration: none;
}

.sidebar-item:hover {
    background: var(--accent-hover-bg);
    border-color: rgba(31, 122, 119, 0.70);
    color: #0b1324;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
}

.sidebar-item.is-active {
    background: rgba(31, 122, 119, 0.95);
    border-color: rgba(31, 122, 119, 0.95);
    color: #ffffff;
}

.is-hidden {
    display: none;
}

.admin-panel-title {
    margin-top: 0;
    margin-bottom: 12px;
}

.panel-block {
    margin-top: 16px;
}

.admin-panel .panel-block:first-of-type {
    margin-top: 0;
}

.stats-container {
    margin-top: 16px;
    background: var(--shell-panel-bg);
    border: 1px solid #dbeafe;
    border-radius: var(--shell-radius);
    padding: 16px 14px;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.10);
}

#panel-stats .stats-container:first-of-type {
    margin-top: 0;
}

.manage-container {
    margin-top: 16px;
    background: var(--shell-panel-bg);
    border: 1px solid #dbeafe;
    border-radius: var(--shell-radius);
    padding: 16px 14px;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.10);
}

#panel-admin .manage-container:first-of-type {
    margin-top: 0;
}

.stats-container h3:not(.container-title),
.manage-container h3:not(.container-title) {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.stats-container .hint,
.manage-container .hint {
    margin: -2px 0 12px;
    color: rgba(15, 23, 42, 0.55);
}

.container-title {
    text-align: center;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.4px;
    margin: 0 0 14px;
}

.stats-filter .container-title {
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 10px;
}

.stats-filter {
    --control-height: 40px;
    --control-font-size: 13px;
}

.stats-filter .filter-row {
    gap: 18px;
}

.stats-filter .filter-group {
    padding: 4px 6px;
    gap: 6px;
}

.stats-filter .filter-item {
    gap: 6px;
}

.stats-filter label {
    font-size: 13px;
}

.stats-filter .btn-link {
    padding: 0 14px;
}

.login-footer-text {
    margin-top: 24px;
    font-size: 12px;
    color: #000000;
    text-align: center;
}

.inline-input {
    width: 100%;
    min-width: 140px;
    padding: 6px 8px;
    font-size: 13px;
}

.time-input {
    min-width: 96px;
}

.op-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.op-cell form {
    margin: 0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-detail-table {
    min-width: 1120px;
}

.admin-detail-table .inline-input {
    min-width: 88px;
    height: 34px;
    padding: 4px 6px;
}

.admin-detail-table .time-input {
    min-width: 78px;
}

.admin-detail-table td:nth-child(6) .inline-input {
    min-width: 140px;
}

.admin-detail-table .op-cell {
    min-width: 124px;
    gap: 6px;
}

.admin-detail-table .op-cell button {
    min-width: 54px;
    padding: 7px 8px;
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .container {
        margin: 12px auto;
        padding: 0 10px 14px;
    }

    .card {
        padding: 14px;
        border-radius: 10px;
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .segment-row {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .row {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid,
    .user-manage-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        gap: 8px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-row input[type="date"],
    .filter-row select,
    .filter-row .btn-link,
    .filter-row button {
        width: 100%;
        min-width: 0;
    }

    .date-range {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-detail-table {
        min-width: 980px;
    }

    .admin-detail-table .op-cell {
        min-width: 118px;
    }

    .login-form {
        gap: 10px;
    }

    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        width: 100%;
        position: static;
        top: auto;
        margin-bottom: 10px;
    }

    .sidebar-item {
        margin-bottom: 10px;
    }
}
