:root {
    --blue: #0b58b8;
    --blue-dark: #084999;
    --ink: #1f2937;
    --muted: #8b95a5;
    --line: #e7ebf1;
    --panel: rgba(255, 255, 255, 0.86);
    --bg: #eef1f6;
    --danger: #b42318;
    --success: #087443;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: var(--blue);
    text-decoration: none;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #d8dbe3;
}

.login-card {
    width: min(1200px, 100%);
    min-height: 704px;
    display: grid;
    grid-template-columns: 1.55fr 0.95fr;
    overflow: hidden;
    background: #f8fafc;
    box-shadow: 0 24px 70px rgba(31, 41, 55, 0.16);
}

.login-visual {
    position: relative;
    background: #f7f9fc url("/assets/login-hero.png") center / cover no-repeat;
}

.login-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.5));
}

.login-logo-bar {
    position: absolute;
    z-index: 1;
    top: 32px;
    left: 32px;
    right: 32px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    pointer-events: none;
}

.login-logo {
    display: block;
    width: auto;
    height: auto;
    max-height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(31, 41, 55, 0.12));
}

.login-logo-ucstack {
    max-width: clamp(180px, 18vw, 220px);
}

.login-logo-itw {
    max-width: clamp(96px, 10vw, 120px);
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 64px;
    background: linear-gradient(90deg, rgba(255,255,255,0.78), rgba(255,255,255,0.94));
}

.login-form {
    width: 100%;
    max-width: 360px;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 14px;
    font-size: 34px;
    font-weight: 500;
    letter-spacing: 0;
}

.subcopy {
    margin: 0 0 46px;
    color: #a0a8b5;
    font-size: 14px;
    line-height: 1.7;
}

.field {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 9px;
    color: #a0a8b5;
    font-size: 13px;
}

input,
select {
    width: 100%;
    height: 52px;
    border: 1px solid #e8ebf1;
    background: #eef1f6;
    padding: 0 18px;
    color: var(--ink);
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

input:focus,
select:focus {
    border-color: #9fc1f0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(11, 88, 184, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border: 0;
    background: var(--blue);
    color: #fff;
    padding: 0 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.18s, transform 0.18s;
}

.btn:hover {
    background: var(--blue-dark);
}

.btn:active {
    transform: translateY(1px);
}

.btn-full {
    width: 100%;
}

.btn-light {
    background: #edf3fb;
    color: var(--blue);
}

.btn-light:hover {
    background: #dfeaf8;
}

.alert {
    margin: 0 0 22px;
    padding: 13px 14px;
    border-left: 3px solid var(--danger);
    background: #fff1f0;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
}

.alert-success {
    border-left-color: var(--success);
    background: #ecfdf3;
    color: var(--success);
}

.footer-note {
    margin-top: 76px;
    color: #a5adba;
    font-size: 13px;
    text-align: center;
}

.legal-footer {
    color: #8b95a5;
    font-size: 12px;
    line-height: 1.65;
}

.legal-footer p {
    margin: 0;
}

.legal-footer a {
    color: #6b7280;
}

.legal-footer a:hover {
    color: var(--blue);
}

.legal-footer-login {
    width: min(1200px, 100%);
    margin-top: 14px;
    text-align: center;
}

.legal-footer-admin {
    width: calc(100% - 56px);
    max-width: 1680px;
    margin: -24px auto 30px;
    text-align: left;
}

.app-shell {
    min-height: 100vh;
    background: #f5f7fb;
}

.topbar {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.brand {
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 14px;
}

.content {
    width: min(1120px, calc(100% - 40px));
    margin: 32px auto;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.page-title h1 {
    font-size: 28px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.card,
.table-wrap {
    background: #fff;
    border: 1px solid var(--line);
    padding: 22px;
}

.metric {
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    display: block;
    margin-top: 12px;
    color: var(--ink);
    font-size: 30px;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

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

th {
    color: var(--muted);
    font-weight: 600;
}

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

.inline-form {
    display: inline;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 160px 150px;
    gap: 14px;
    align-items: start;
    margin-bottom: 22px;
}

.small {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 860px) {
    .login-card {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 280px;
    }

    .login-logo-bar {
        top: 20px;
        left: 20px;
        right: 20px;
        gap: 16px;
    }

    .login-logo {
        max-height: 38px;
    }

    .login-logo-ucstack {
        max-width: clamp(132px, 38vw, 170px);
    }

    .login-logo-itw {
        max-width: clamp(72px, 22vw, 96px);
    }

    .login-panel {
        padding: 36px 24px;
    }

    .legal-footer-login {
        margin-top: 12px;
        padding: 0 4px;
    }

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

    .topbar,
    .page-title {
        align-items: flex-start;
        flex-direction: column;
        height: auto;
        padding: 20px;
    }
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr;
    background: #f5f7fb;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: #fff;
    padding: 18px 14px;
}

.side-brand {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    font-weight: 700;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
}

.side-nav {
    display: grid;
    gap: 4px;
    margin-top: 18px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: #5d6676;
    font-size: 14px;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    object-fit: contain;
    opacity: 0.9;
    filter: brightness(0) saturate(100%) invert(42%) sepia(13%) saturate(514%) hue-rotate(179deg) brightness(90%) contrast(88%);
    transition: filter 0.18s, opacity 0.18s;
}

.side-nav a.active,
.side-nav a:hover {
    background: #edf4ff;
    color: var(--blue);
}

.side-nav a.active .nav-icon,
.side-nav a:hover .nav-icon {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(26%) sepia(98%) saturate(1631%) hue-rotate(197deg) brightness(90%) contrast(96%);
}

.side-group {
    margin: 16px 12px 8px;
    color: #a1a9b6;
    font-size: 12px;
}

.side-card {
    margin-top: auto;
    border-radius: 8px;
    background: linear-gradient(135deg, #0b58b8, #2d7ff0);
    color: #fff;
    padding: 18px;
}

.side-card span,
.side-card strong {
    display: block;
}

.side-card strong {
    margin-top: 8px;
    font-size: 18px;
}

.main-area {
    min-width: 0;
}

.admin-topbar {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    padding: 0 28px;
}

.search-box {
    width: min(420px, 45vw);
}

.search-box input {
    height: 40px;
    border-radius: 999px;
    background: #f5f7fb;
}

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

.notify {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
}

.notify b {
    min-width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    margin-left: 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
}

.user-chip {
    color: #5d6676;
    font-size: 14px;
}

.page {
    width: calc(100% - 56px);
    max-width: 1680px;
    margin: 28px auto 48px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-heading h1 {
    font-size: 28px;
}

.stat-grid,
.panel-grid {
    display: grid;
    gap: 18px;
}

.stat-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 18px;
}

.stat-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(31, 41, 55, 0.04);
}

.stat-card {
    padding: 22px;
}

.stat-card span,
.stat-card em {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin: 10px 0;
    font-size: 30px;
}

.panel {
    margin-bottom: 18px;
    padding: 22px;
    overflow-x: auto;
}

.panel-grid {
    grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr);
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.panel-title h2,
.panel h2 {
    margin: 0 0 12px;
    font-size: 17px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #e9f8ef;
    color: #087443;
    font-size: 12px;
}

.badge.muted {
    background: #eef2f7;
    color: #667085;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.table-search,
.actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-search input,
.table-search select,
.actions select {
    height: 38px;
}

.actions form {
    display: inline-flex;
    gap: 6px;
}

.form-grid {
    grid-template-columns: repeat(4, 1fr);
}

.form-grid > .btn {
    grid-column: 1 / -1;
    justify-self: start;
    width: auto;
    min-width: 128px;
    min-height: 44px;
    margin-top: 0;
    padding: 0 18px;
}

.employee-form,
.appointment-form .form-grid,
.settings-form .form-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

@media (min-width: 1281px) {
    .employee-form {
        grid-template-columns: repeat(6, minmax(120px, 1fr));
    }
}

.checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--ink);
}

.checkline input {
    width: auto;
    height: auto;
}

.service-meter {
    display: grid;
    place-items: center;
    min-height: 180px;
    border-radius: 8px;
    background: radial-gradient(circle at center, #eef7ff, #fff 65%);
    text-align: center;
}

.service-meter strong {
    display: block;
    color: var(--blue);
    font-size: 30px;
}

.service-meter.large {
    min-height: 240px;
}

.cli-note {
    padding: 14px;
    border-radius: 8px;
    background: #111827;
    color: #d1d5db;
    overflow-x: auto;
}

@media (max-width: 980px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        height: auto;
    }
    .stat-grid,
    .panel-grid,
    .form-grid,
    .employee-form,
    .appointment-form .form-grid,
    .settings-form .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid > .btn {
        margin-top: 0;
    }
    .admin-topbar {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }
    .search-box {
        width: 100%;
    }
}
