:root {
    --bg: #f4f7fb;
    --bg-soft: #eef4ff;
    --panel: #ffffff;
    --panel-2: #f8fbff;
    --line: rgba(15, 23, 42, 0.09);
    --line-strong: rgba(15, 23, 42, 0.14);
    --text: #0f172a;
    --muted: #667085;
    --primary: #0ea5e9;
    --primary-2: #14b8a6;
    --secondary: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --orange: #f97316;
    --purple: #8b5cf6;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.05);
    --radius: 20px;
    --radius-sm: 12px;
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.11), transparent 24%),
        linear-gradient(180deg, #f9fbff 0%, #f3f7fc 55%, #eef3f9 100%);
}

body {
    background-color: var(--bg);
}

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

button, input, select, textarea {
    font: inherit;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(14, 165, 233, 0.75);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

textarea {
    resize: vertical;
}

code {
    background: #eff6ff;
    color: #0f172a;
    padding: 0.16rem 0.42rem;
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.app-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 255, 0.92));
    border-right: 1px solid var(--line);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    backdrop-filter: blur(12px);
}

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

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 16px 30px rgba(14, 165, 233, 0.22);
}

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

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

.nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    padding: 12px 14px;
    border-radius: 14px;
    color: #334155;
    background: transparent;
    border: 1px solid transparent;
    transition: 180ms ease;
}

.nav-link:hover,
.nav-link.active {
    color: #0f172a;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.10), rgba(20, 184, 166, 0.08));
    border-color: rgba(14, 165, 233, 0.14);
    box-shadow: var(--shadow-soft);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 14px;
}

.user-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-soft);
}

.user-name {
    font-weight: 700;
}

.user-meta,
.muted {
    color: var(--muted);
    font-size: 0.92rem;
}

.main-content {
    padding: 28px;
}

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

.topbar h1,
.auth-card h1 {
    margin: 0 0 6px;
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.topbar p,
.auth-text {
    margin: 0;
    color: var(--muted);
}

.topbar-actions,
.actions,
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.panel,
.stat-card,
.detail-card,
.info-card {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.98));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 20px;
    margin-bottom: 20px;
}

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

.panel-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.stat-grid,
.detail-grid,
.info-grid {
    display: grid;
    gap: 16px;
}

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

.stat-card,
.detail-card,
.info-card {
    padding: 18px;
}

.stat-label,
.detail-label {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.stat-value,
.detail-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.detail-grid,
.info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.table-wrap {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
}

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

th {
    color: #64748b;
    font-weight: 700;
    font-size: 0.88rem;
    background: #f8fbff;
}

tbody tr:hover {
    background: rgba(14, 165, 233, 0.03);
}

.badge,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge-secondary, .chip.badge-secondary { background: #f1f5f9; color: #334155; }
.badge-success, .chip.badge-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-warning, .chip.badge-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-info, .chip.badge-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge-primary, .chip.badge-primary { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.badge-orange, .chip.badge-orange { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge-danger, .chip.badge-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-purple, .chip.badge-purple { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.badge-teal, .chip.badge-teal { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 11px 14px;
    cursor: pointer;
    transition: 180ms ease;
    color: #0f172a;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #ffffff;
    font-weight: 700;
}

.btn-secondary {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.btn-outline {
    background: #fff;
    border-color: var(--line-strong);
    color: #334155;
}

.btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--line);
    color: #334155;
}

.btn-small {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
}

.copy-target {
    cursor: pointer;
    border-radius: 5px;
    padding: 3px 5px;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.copy-target:hover,
.copy-target:focus-visible,
.copy-target.is-copied {
    background: #eff6ff;
    color: #0369a1;
    box-shadow: 0 0 0 2px #dbeafe;
    outline: none;
}

.copy-target::after {
    content: ' • copy';
    color: #94a3b8;
    font-family: inherit;
    font-size: 10px;
    font-weight: 400;
    opacity: 0;
    transition: opacity 160ms ease;
}

.copy-target:hover::after,
.copy-target:focus-visible::after,
.copy-target.is-copied::after {
    opacity: 1;
}


.btn-block {
    width: 100%;
}

.stack {
    display: grid;
    gap: 14px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 0.92rem;
    color: var(--muted);
}

.field-full {
    grid-column: 1 / -1;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.inline {
    display: inline;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 24px 12px;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-soft);
}

.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }

.form-panel {
    max-width: 1100px;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    margin-top: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.10);
}

.timeline-content {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.timeline-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-meta,
.timeline-note {
    color: var(--muted);
    font-size: 0.92rem;
}

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

.import-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 26px;
    margin-bottom: 18px;
    border-radius: 14px;
    color: var(--ink);
    background: #f8fbff;
    border: 1px solid var(--line);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .035);
}

.import-guide-icon { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #2563eb; background: #dbeafe; font-weight: 800; }
.import-guide h2 { margin: 5px 0 7px; font-size: 1.35rem; letter-spacing: -.02em; }
.import-guide p { max-width: 760px; margin: 0; color: var(--muted); }
.guide-list { display: grid; gap: 5px; margin: 13px 0 0; padding-left: 19px; color: #475569; font-size: .88rem; }
.guide-list li { padding-left: 3px; }
.guide-list code { color: #334155; font-size: .82rem; }
.eyebrow { font-size: .68rem; letter-spacing: .14em; font-weight: 800; color: #2563eb; }
.text-link { color: #2563eb; font-weight: 700; white-space: nowrap; }

.template-panel { margin-bottom: 18px; }
.template-panel .panel-head p { margin: 5px 0 0; }
.template-table th { white-space: nowrap; }
.template-table td { vertical-align: middle; }
.template-table code { color: #334155; font-size: .82rem; }
.sheet-badge { display: inline-block; padding: 5px 9px; border-radius: 7px; color: #475569; background: #f1f5f9; font-size: .78rem; font-weight: 700; }
.template-action { text-align: right; white-space: nowrap; }

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

.import-step { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.import-step > span { color: #2563eb; font-size: .75rem; font-weight: 800; letter-spacing: .05em; }
.import-step strong, .import-step small { display: block; }
.import-step small { margin-top: 3px; color: var(--muted); font-size: .8rem; }

.import-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.import-template-card { display: flex; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(15, 23, 42, .04); }
.template-icon { flex: 0 0 46px; height: 46px; display: grid; place-items: center; border-radius: 11px; font-size: .78rem; letter-spacing: .04em; font-weight: 800; }
.template-icon-blue { color: #1d4ed8; background: #dbeafe; }
.template-icon-orange { color: #c2410c; background: #ffedd5; }
.template-card-body { min-width: 0; flex: 1; }
.template-card-head h3 { margin: 0 0 5px; font-size: 1.15rem; }
.template-badge { color: var(--muted); font-size: .76rem; }
.template-card-body p { min-height: 42px; margin: 15px 0; color: var(--muted); }
.template-file { display: grid; gap: 5px; margin-bottom: 16px; color: var(--muted); font-size: .68rem; letter-spacing: .06em; }
.template-file code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; }
.import-note { margin-bottom: 18px; }
.note-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.note-grid strong, .note-grid span { display: block; }
.note-grid span { margin-top: 5px; color: var(--muted); font-size: .88rem; }

.command-item {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(520px, 100%);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98));
    border-radius: 28px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.auth-card .stack {
    margin-top: 18px;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .stat-grid,
    .detail-grid,
    .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .main-content {
        padding: 18px;
    }

    .topbar,
    .panel-head,
    .search-bar,
    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .grid-2,
    .stat-grid,
    .detail-grid,
    .info-grid,
    .import-steps,
    .import-template-grid,
    .note-grid {
        grid-template-columns: 1fr;
    }

    .import-guide {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .sidebar {
        padding: 18px 16px;
    }
}
