:root {
    --bg-page: #f6f8fb;
    --bg-surface: #ffffff;
    --bg-soft: #eef6f8;
    --bg-muted: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #718096;
    --border-color: #dbe3ea;
    --border-strong: #c4d0da;
    --primary-color: #0b8aa6;
    --primary-hover: #08748c;
    --primary-soft: #e4f5f8;
    --success-color: #15803d;
    --warning-color: #b7791f;
    --danger-color: #b42318;
    --info-color: #08748c;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --font-sans: "Inter", "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
    --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --sidebar-width: 272px;
    --topbar-height: 82px;
    --transition: 160ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-primary);
    background:
        linear-gradient(180deg, rgba(232, 244, 247, 0.78) 0, rgba(246, 248, 251, 0) 340px),
        var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--primary-hover);
}

::selection {
    background: rgba(11, 138, 166, 0.18);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
}

h1 {
    font-size: 2rem;
}

h1[tabindex="-1"]:focus {
    outline: none;
}

h2 {
    font-size: 1.3rem;
}

h3 {
    font-size: 1.05rem;
}

h4 {
    font-size: 1rem;
}

p {
    margin: 0;
    color: var(--text-secondary);
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.app-icon {
    width: 1.1em;
    height: 1.1em;
    display: inline-block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.page {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.92);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(18px);
}

.sidebar-header {
    padding: 1.25rem 1rem 1rem;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.sidebar-logo:hover {
    color: var(--text-primary);
}

.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: #ffffff;
    background: linear-gradient(135deg, #0b8aa6, #0f766e);
    box-shadow: 0 12px 24px rgba(11, 138, 166, 0.22);
}

.sidebar-logo-icon .app-icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.6;
}

.sidebar-logo-text {
    display: grid;
    gap: 0.1rem;
}

.sidebar-logo-text strong {
    font-size: 0.98rem;
    line-height: 1.15;
}

.sidebar-logo-text small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.25rem 0.65rem 1rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.15rem;
}

.nav-section-title {
    padding: 0.45rem 0.65rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 40px;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-muted);
}

.nav-item.active {
    color: var(--primary-color);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px rgba(11, 138, 166, 0.12);
}

.nav-item-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 1rem 1rem;
    padding: 0.85rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.main-content {
    min-height: 100vh;
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.top-bar {
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(246, 248, 251, 0.86);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(18px);
}

.top-bar-title {
    display: grid;
    gap: 0.2rem;
}

.top-bar-title .top-title {
    font-size: 1.35rem;
    font-weight: 750;
    line-height: 1.2;
}

.top-bar-title p {
    font-size: 0.86rem;
    color: var(--text-muted);
}

.top-bar-actions,
.hero-actions,
.btn-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.content-area {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.dashboard-shell {
    display: grid;
    gap: 1.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 1rem;
}

.hero-panel,
.progress-panel,
.surface-panel,
.summary-panel,
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.hero-panel {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.75rem;
}

.hero-panel h1 {
    margin-bottom: 0.75rem;
    font-size: 2.05rem;
}

.hero-panel p {
    max-width: 620px;
    font-size: 1rem;
}

.progress-panel {
    padding: 1.55rem;
}

.panel-heading,
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.panel-heading {
    color: var(--text-secondary);
    font-weight: 700;
}

.panel-heading strong {
    color: var(--primary-color);
}

.progress-count {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    margin: 1.25rem 0 0.85rem;
}

.progress-count span {
    color: var(--primary-color);
    font-size: 2.65rem;
    font-weight: 750;
    line-height: 1;
}

.progress-count small,
.summary-row-content small,
.quick-card small {
    color: var(--text-muted);
}

.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-muted);
}

.progress-track span {
    display: block;
    height: 100%;
    min-width: 8px;
    border-radius: inherit;
    background: linear-gradient(90deg, #0b8aa6, #11a7a7);
}

.progress-note {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.dashboard-content {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.dashboard-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.surface-panel,
.summary-panel {
    padding: 1.25rem;
    min-width: 0;
}

.section-heading {
    margin-bottom: 1rem;
}

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

.section-heading p {
    margin-top: 0.25rem;
    font-size: 0.87rem;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.quick-card {
    min-width: 0;
    min-height: 96px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: #ffffff;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.quick-card:hover {
    color: var(--text-primary);
    border-color: rgba(11, 138, 166, 0.45);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.quick-card-icon,
.summary-row-icon,
.card-title-icon,
.list-item-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--primary-color);
    background: var(--primary-soft);
    font-size: 0;
}

.quick-card-icon .app-icon,
.summary-row-icon .app-icon,
.card-title-icon .app-icon,
.list-item-icon .app-icon {
    width: 21px;
    height: 21px;
    font-size: 1rem;
}

.quick-card strong,
.summary-row-content strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.quick-card small,
.summary-row-content small {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.82rem;
}

.quick-card-arrow,
.summary-row-arrow {
    color: var(--text-muted);
}

.summary-list {
    display: grid;
}

.summary-row {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    min-height: 58px;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.summary-row:last-child {
    border-bottom: 0;
}

.summary-row:hover strong {
    color: var(--primary-color);
}

.code-window {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.code-window-bar {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.icon-button {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: #ffffff;
}

.icon-button:hover {
    color: var(--primary-color);
    border-color: rgba(11, 138, 166, 0.45);
}

.card {
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.card-header:hover {
    background: #fbfdff;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
}

.card-title-icon {
    width: 34px;
    height: 34px;
}

.card-toggle {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.card-toggle.collapsed {
    transform: rotate(-90deg);
}

.card-body {
    padding: 1.15rem;
    overflow-x: auto;
}

.card-body.collapsed {
    display: none;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 700;
}

.form-label-hint {
    margin-left: 0.4rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    width: 100%;
    min-height: 42px;
    padding: 0.62rem 0.75rem;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:hover {
    border-color: var(--border-strong);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(11, 138, 166, 0.12);
}

.form-control::placeholder {
    color: #9aa8b5;
}

.form-control:disabled {
    color: var(--text-muted);
    background: var(--bg-muted);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: var(--font-mono);
}

select.form-control {
    cursor: pointer;
}

.form-hint,
.form-error {
    margin-top: 0.4rem;
    font-size: 0.82rem;
}

.form-hint {
    color: var(--text-muted);
}

.form-error {
    color: var(--danger-color);
}

.input-group {
    display: flex;
    gap: 1rem;
}

.input-group > * {
    min-width: 0;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.form-check-label {
    color: var(--text-primary);
    cursor: pointer;
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    cursor: pointer;
}

.toggle-switch + .toggle-switch {
    border-top: 1px solid var(--border-color);
}

.toggle-switch-label {
    display: grid;
    gap: 0.15rem;
}

.toggle-switch-title {
    color: var(--text-primary);
    font-weight: 700;
}

.toggle-switch-desc {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.toggle-track {
    width: 44px;
    height: 24px;
    position: relative;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background var(--transition);
}

.toggle-track.active {
    background: var(--primary-color);
}

.toggle-thumb {
    width: 20px;
    height: 20px;
    position: absolute;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
}

.toggle-track.active .toggle-thumb {
    transform: translateX(20px);
}

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0.95rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.btn .app-icon {
    width: 1rem;
    height: 1rem;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #0b8aa6, #08748c);
    box-shadow: 0 12px 24px rgba(11, 138, 166, 0.2);
}

.btn-primary:hover:not(:disabled) {
    color: #ffffff;
    background: linear-gradient(135deg, #08748c, #075e72);
    transform: translateY(-1px);
}

.btn-secondary {
    color: var(--text-primary);
    background: #ffffff;
    border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
    color: var(--primary-color);
    border-color: rgba(11, 138, 166, 0.45);
    background: #fbfdff;
}

.btn-success {
    color: #ffffff;
    background: var(--success-color);
}

.btn-danger {
    color: #ffffff;
    background: var(--danger-color);
}

.btn-ghost {
    color: var(--text-secondary);
    background: transparent;
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--primary-color);
    background: var(--primary-soft);
}

.btn-sm {
    min-height: 34px;
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
}

.btn-lg {
    min-height: 46px;
    padding: 0.75rem 1.05rem;
    font-size: 0.94rem;
}

.btn-block {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.badge-primary {
    color: var(--primary-color);
    background: var(--primary-soft);
}

.badge-success {
    color: var(--success-color);
    background: #e8f7ee;
}

.badge-warning {
    color: var(--warning-color);
    background: #fff7e6;
}

.badge-danger {
    color: var(--danger-color);
    background: #fff0ee;
}

.tabs {
    display: inline-flex;
    max-width: 100%;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    overflow-x: auto;
}

.tab {
    min-height: 34px;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: transparent;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-color);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: #ffffff;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.option-item:hover {
    border-color: rgba(11, 138, 166, 0.45);
    box-shadow: var(--shadow-sm);
}

.option-item.selected {
    border-color: var(--primary-color);
    background: var(--primary-soft);
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
    border-bottom: 0;
}

.list-item-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1;
}

.list-item-icon::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid currentColor;
}

.list-item-icon:has(.app-icon)::before {
    display: none;
}

.list-item-text {
    min-width: 0;
    flex: 1;
}

.list-item-title {
    color: var(--text-primary);
    font-weight: 700;
}

.list-item-subtitle {
    margin-top: 0.12rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-secondary);
}

.alert > span:first-child {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    font-size: 0;
}

.alert > span:first-child::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}

.alert p {
    color: inherit;
}

.alert-info {
    color: var(--info-color);
    background: #edf8fb;
    border-color: #b9e3ea;
}

.alert-success {
    color: var(--success-color);
    background: #edf9f1;
    border-color: #bde8ca;
}

.alert-warning {
    color: var(--warning-color);
    background: #fff8ea;
    border-color: #f4d590;
}

.alert-danger {
    color: var(--danger-color);
    background: #fff1ef;
    border-color: #ffc9c2;
}

code {
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    color: #075985;
    background: #eef6ff;
    font-family: var(--font-mono);
    font-size: 0.87em;
}

pre {
    margin: 0 0 1rem;
    overflow: auto;
    font-family: var(--font-mono);
}

pre code {
    padding: 0;
    color: inherit;
    background: transparent;
}

.code-preview {
    max-height: 600px;
    max-width: 100%;
    overflow: auto;
    margin: 0;
    padding: 1rem;
    color: #1e3a5f;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre;
    word-wrap: normal;
}

.code-preview.compact {
    max-height: 250px;
    border: 0;
    border-radius: 0;
}

.not-found-panel {
    display: grid;
    gap: 1rem;
    max-width: 560px;
    padding: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 0.5rem !important;
}

.mt-2 {
    margin-top: 1rem !important;
}

.mt-3 {
    margin-top: 1.5rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.5rem !important;
}

.mb-2 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 1.5rem !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 0.5rem !important;
}

.p-2 {
    padding: 1rem !important;
}

.p-3 {
    padding: 1.5rem !important;
}

.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 220ms ease-out;
}

.animate-slide-in {
    animation: fadeIn 220ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (max-width: 1180px) {
    .dashboard-grid,
    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .summary-panel {
        position: static;
    }
}

@media (max-width: 1500px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .page {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        position: relative;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        max-height: none;
    }

    .nav-section {
        margin-bottom: 0;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .top-bar {
        position: static;
    }
}

@media (max-width: 720px) {
    h1 {
        font-size: 1.65rem;
    }

    .top-bar {
        align-items: flex-start;
        flex-direction: column;
        padding: 1rem;
    }

    .top-bar-actions,
    .hero-actions {
        width: 100%;
    }

    .top-bar-actions .btn,
    .hero-actions .btn {
        flex: 1;
    }

    .content-area {
        padding: 1rem;
    }

    .hero-panel,
    .progress-panel,
    .surface-panel,
    .summary-panel,
    .card-body {
        padding: 1rem;
    }

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

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

    .sidebar-header {
        padding: 0.85rem 1rem 0.55rem;
    }

    .sidebar-logo-icon {
        width: 38px;
        height: 38px;
    }

    .sidebar-nav {
        display: flex;
        gap: 0.5rem;
        padding: 0.35rem 1rem 0.8rem;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
    }

    .nav-section {
        display: contents;
    }

    .nav-section-title {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
        min-height: 36px;
        white-space: nowrap;
        scroll-snap-align: start;
        background: #ffffff;
        border: 1px solid var(--border-color);
    }

    .input-group {
        flex-direction: column;
        gap: 0;
    }

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

    .tabs {
        display: flex;
        width: 100%;
    }

    .tab {
        flex: 1 0 auto;
    }

    .list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .list-item-actions,
    .btn-group {
        width: 100%;
    }

    .list-item-actions .btn,
    .btn-group .btn {
        flex: 1;
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 1000;
    padding: 0.9rem 3rem 0.9rem 1rem;
    border: 1px solid #ffc9c2;
    border-radius: var(--radius-md);
    color: var(--danger-color);
    background: #fff1ef;
    box-shadow: var(--shadow-md);
}

#blazor-error-ui .reload {
    margin-left: 0.5rem;
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    cursor: pointer;
}
