:root {
    --bg: #09090c;
    --panel: #0d0d11;
    --surface: #121217;
    --surface-2: #17171d;
    --surface-3: #1e1e25;
    --border: #22222b;
    --border-strong: #2e2e39;
    --text: #f2f2f5;
    --text-2: #a3a3ae;
    --text-3: #6d6d78;
    --accent: #5c8bff;
    --accent-strong: #7ba3ff;
    --accent-soft: rgba(92, 139, 255, 0.13);
    --green: #3dd68c;
    --green-soft: rgba(61, 214, 140, 0.12);
    --amber: #e8a33d;
    --amber-soft: rgba(232, 163, 61, 0.12);
    --red: #ff5f57;
    --red-soft: rgba(255, 95, 87, 0.12);
    --white-btn: #fafafa;
    --white-btn-text: #0b0b0d;
    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-pop: 0 4px 12px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --side-w: 248px;
    --topbar-h: 60px;
    --content-max: 1240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.no-scroll {
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-strong);
}

img {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

::selection {
    background: var(--accent-soft);
    color: var(--text);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 99px;
    border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: #3c3c48;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

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

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--side-w);
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-right: 1px solid var(--border);
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    padding: 22px 24px 20px;
    flex-shrink: 0;
}

.brand img {
    height: 26px;
    width: auto;
}

.side-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 14px 14px;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 36px;
    padding: 0 11px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
    transition: background 0.13s ease, color 0.13s ease;
    white-space: nowrap;
}

.menu-item i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-3);
    transition: color 0.13s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.menu-item:hover i {
    color: var(--text-2);
}

.menu-item.active {
    background: var(--surface-2);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border);
}

.menu-item.active i {
    color: var(--accent);
}

.side-sep {
    height: 1px;
    background: var(--border);
    margin: 10px 4px;
    flex-shrink: 0;
}

.menu-item.danger:hover {
    color: var(--red);
    background: var(--red-soft);
}

.menu-item.danger:hover i {
    color: var(--red);
}

.side-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.side-foot a {
    color: var(--text-3);
}

.side-foot a:hover {
    color: var(--text-2);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.shell {
    flex: 1;
    min-width: 0;
    margin-left: var(--side-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    height: var(--topbar-h);
    padding: 0 32px;
    background: rgba(9, 9, 12, 0.82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.page-title i {
    font-size: 18px;
    color: var(--text-3);
}

.topbar-side {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content {
    flex: 1;
    width: 100%;
    max-width: var(--content-max);
    padding: 30px 32px 56px;
}

.content > * + * {
    margin-top: 20px;
}

.content > * {
    animation: fade-up 0.28s ease backwards;
}

.content > .modal,
.content > .ctx-menu {
    margin-top: 0;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
}

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

.card-head.no-margin {
    margin-bottom: 0;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.card-sub {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
}

.service-create-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.service-create-row .card-sub {
    margin-top: 4px;
}

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

.card-grid > .card {
    margin-top: 0;
}

.content > .card-grid + * {
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 550;
    letter-spacing: -0.003em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease, transform 0.08s ease, box-shadow 0.13s ease;
    text-decoration: none;
}

.btn i {
    font-size: 16px;
    flex-shrink: 0;
}

.btn:active {
    transform: translateY(0.5px) scale(0.99);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--white-btn);
    color: var(--white-btn-text);
}

.btn-primary:hover:not(:disabled) {
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 18px rgba(255, 255, 255, 0.07);
}

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

.btn-accent:hover:not(:disabled) {
    background: #4478f0;
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: #37374a;
}

.btn-danger {
    background: var(--red-soft);
    color: var(--red);
    border-color: rgba(255, 95, 87, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(255, 95, 87, 0.19);
}

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

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
    gap: 6px;
}

.btn-sm i {
    font-size: 14px;
}

.btn-wide {
    width: 100%;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    cursor: pointer;
    font-size: 17px;
    transition: background 0.13s ease, color 0.13s ease;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

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

.icon-btn.danger:hover {
    background: var(--red-soft);
    color: var(--red);
}

.burger {
    display: none;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.75;
}

.btn .spin {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: rot 0.7s linear infinite;
    flex-shrink: 0;
    opacity: 0.8;
}

.btn.is-loading .spin {
    display: inline-block;
}

@keyframes rot {
    to {
        transform: rotate(360deg);
    }
}

.spin-lg {
    width: 26px;
    height: 26px;
    border: 3px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: rot 0.8s linear infinite;
}

.field {
    margin-bottom: 16px;
}

.field:last-child {
    margin-bottom: 0;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 550;
    color: var(--text-2);
    letter-spacing: 0.002em;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea,
.input {
    width: 100%;
    height: 40px;
    padding: 0 13px;
    background: var(--surface-2);
    border: 1px solid #3a3a45;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.13s ease, background 0.13s ease, box-shadow 0.13s ease;
    appearance: none;
    -webkit-appearance: none;
}

.field textarea {
    height: auto;
    min-height: 120px;
    padding: 11px 13px;
    line-height: 1.55;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.input::placeholder {
    color: var(--text-3);
}

.field input:hover:not(:disabled):not(:focus),
.field select:hover:not(:disabled):not(:focus),
.field textarea:hover:not(:disabled):not(:focus),
.input:hover:not(:disabled):not(:focus) {
    border-color: #4a4a58;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface-3);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled,
.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.field input[readonly],
.input[readonly] {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    letter-spacing: 0.01em;
    color: var(--text-2);
}

.field select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23a3a3ae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 38px;
    cursor: pointer;
}

.field select option {
    background: var(--surface-2);
    color: var(--text);
}

.field-hint {
    margin-top: 7px;
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group .input,
.input-group input {
    flex: 1;
    min-width: 0;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}

.check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.check .mark {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.13s ease, border-color 0.13s ease;
    position: relative;
}

.check .mark::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.12s ease;
    margin-top: -2px;
}

.check input:checked + .mark {
    background: var(--accent);
    border-color: var(--accent);
}

.check input:checked + .mark::after {
    transform: rotate(-45deg) scale(1);
}

.check:hover .mark {
    border-color: #3d3d4d;
}

.check input:disabled + .mark {
    opacity: 0.45;
    cursor: not-allowed;
}

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

.check-grid .check {
    padding: 9px 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.13s ease, background 0.13s ease;
}

.check-grid .check:hover {
    border-color: var(--border-strong);
}

.check-grid .check:has(input:checked) {
    border-color: rgba(92, 139, 255, 0.45);
    background: var(--accent-soft);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -6px;
    padding: 0 6px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #82828e;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: middle;
}

tbody tr {
    transition: background 0.1s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

tbody tr:last-child td {
    border-bottom: none;
}

td:first-child, th:first-child {
    padding-left: 6px;
}

td:last-child, th:last-child {
    padding-right: 6px;
}

.td-main {
    color: var(--text);
    font-weight: 500;
}

.td-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
}

.td-actions {
    text-align: right;
    white-space: nowrap;
}

.td-actions .btn,
.td-actions .icon-btn {
    margin-left: 4px;
}

.num {
    font-variant-numeric: tabular-nums;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 23px;
    padding: 0 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.pill-green {
    background: var(--green-soft);
    color: var(--green);
}

.pill-amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.pill-red {
    background: var(--red-soft);
    color: var(--red);
}

.pill-blue {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.pill-gray {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
}

.dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 42px;
    padding: 0 13px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.13s ease, background 0.13s ease;
    text-align: left;
}

.dropdown-trigger:hover {
    border-color: #3a3a46;
}

.dropdown-trigger .dt-icon {
    font-size: 17px;
    color: var(--text-3);
    flex-shrink: 0;
}

.dropdown-trigger .dt-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-2);
    font-size: 13.5px;
}

.dropdown-trigger .dt-value.filled {
    color: var(--text);
    font-weight: 500;
}

.dropdown-trigger .dt-arrow {
    font-size: 17px;
    color: var(--text-3);
    transition: transform 0.18s ease;
    flex-shrink: 0;
}

.dropdown.open .dt-arrow {
    transform: rotate(180deg);
}

.dropdown.open .dropdown-trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    padding: 6px;
    z-index: 50;
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-label {
    padding: 10px 11px 5px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-3);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.1s ease, color 0.1s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item i {
    font-size: 16px;
    color: var(--text-3);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.segmented {
    display: inline-flex;
    padding: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    gap: 2px;
}

.segmented button {
    height: 30px;
    padding: 0 16px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 550;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.13s ease, color 0.13s ease, box-shadow 0.13s ease;
    white-space: nowrap;
}

.segmented button:hover {
    color: var(--text);
}

.segmented button.active {
    background: var(--surface-3);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border-strong), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.segmented button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 5, 8, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.modal.open {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-pop);
    padding: 24px;
    animation: pop-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-box.wide {
    max-width: 560px;
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title {
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-text {
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.modal-actions .btn {
    min-width: 96px;
}

.toast-zone {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    padding: 12px 16px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    font-size: 13px;
    color: var(--text);
    animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
    pointer-events: auto;
}

.toast i {
    font-size: 17px;
    flex-shrink: 0;
}

.toast.success {
    border-color: rgba(61, 214, 140, 0.35);
}

.toast.success i {
    color: var(--green);
}

.toast.error {
    border-color: rgba(255, 95, 87, 0.35);
}

.toast.error i {
    color: var(--red);
}

.toast.info i {
    color: var(--accent);
}

.toast.hide {
    animation: toast-out 0.22s ease both;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(16px);
    }
}

.banner {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    padding: 13px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.5;
    border: 1px solid;
}

.banner i {
    font-size: 16px;
    line-height: 20.25px;
    flex-shrink: 0;
}

.banner-info {
    background: var(--accent-soft);
    border-color: rgba(92, 139, 255, 0.3);
    color: #b8ccff;
}

.banner-info i {
    color: var(--accent);
}

.banner-warning {
    background: var(--amber-soft);
    border-color: rgba(232, 163, 61, 0.3);
    color: #ecc27e;
}

.banner-warning i {
    color: var(--amber);
}

.banner-danger {
    background: var(--red-soft);
    border-color: rgba(255, 95, 87, 0.3);
    color: #ff9d98;
}

.banner-danger i {
    color: var(--red);
}

.banner .banner-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 20.25px;
    flex-shrink: 0;
}

.banner .banner-close:hover {
    opacity: 1;
}

.banner a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.detail-item {
    min-width: 0;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 5px;
}

.detail-value {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
    word-break: break-word;
}

.detail-value .num {
    font-weight: 550;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 44px 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 13.5px;
}

.empty-state i {
    font-size: 30px;
    opacity: 0.55;
}

.loading-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 44px 20px;
    color: var(--text-3);
    font-size: 13px;
}

.hidden-row {
    display: none;
}

.show-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.plan-details {
    animation: fade-up 0.25s ease both;
}

.plan-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-2);
    min-width: 0;
}

.feature i {
    font-size: 16px;
    color: var(--accent);
    flex-shrink: 0;
}

.plan-pricing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 18px 0;
}

.price-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 15px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.price-option .period {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
}

.price-option .price {
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.price-option .savings {
    font-size: 11px;
    color: var(--green);
    font-weight: 550;
    margin-top: 2px;
}

.billing-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.billing-row label {
    font-size: 12.5px;
    font-weight: 550;
    color: var(--text-2);
}

.terms {
    display: block;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

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

.actions-row .btn {
    flex-shrink: 0;
}

.progress {
    height: 8px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
    margin: 14px 0 10px;
}

.progress .bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: var(--accent);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-label {
    font-size: 12.5px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: none;
        padding-left: env(safe-area-inset-left);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-pop);
    }

    .burger {
        display: inline-flex;
    }

    .shell {
        margin-left: 0;
    }

    .topbar {
        padding: 0 20px;
    }

    .content {
        padding: 22px 20px 48px;
    }

    .menu-item {
        height: 40px;
    }

    .side-foot {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .plan-pricing {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .topbar {
        height: calc(54px + env(safe-area-inset-top));
        padding: 0 14px;
        padding-top: env(safe-area-inset-top);
    }

    .page-title {
        font-size: 15px;
    }

    .page-title i {
        font-size: 17px;
    }

    .content {
        padding: 16px 12px calc(44px + env(safe-area-inset-bottom));
    }

    .content > * + * {
        margin-top: 16px;
    }

    .card {
        padding: 16px;
        border-radius: var(--radius);
    }

    .card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 13px;
    }

    .section-title {
        margin-bottom: 12px;
    }

    .btn-sm {
        height: 34px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .field input[type="text"],
    .field input[type="email"],
    .field input[type="password"],
    .field input[type="number"],
    .field select,
    .field textarea,
    .input {
        height: 44px;
        font-size: 15px;
    }

    .field textarea {
        height: auto;
    }

    .dropdown-trigger {
        height: 46px;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

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

    .details {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .check-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    }

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

    .segmented button {
        flex: 1;
        min-width: 0;
        padding: 0 10px;
        height: 34px;
    }

    .actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-row .btn,
    .actions-row .btn-sm {
        width: 100%;
    }

    .billing-row {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .modal {
        padding: 12px;
    }

    .modal-box {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
        max-height: calc(100dvh - 24px);
    }

    .modal-actions .btn {
        flex: 1;
        min-width: 0;
    }

    .toast-zone {
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        align-items: stretch;
    }

    .toast {
        max-width: none;
    }

    .banner {
        gap: 10px;
        padding: 12px 13px;
    }

    .plan-pricing {
        grid-template-columns: 1fr;
    }

    .empty-state {
        padding: 32px 16px;
    }

    table {
        font-size: 13px;
    }

    th {
        font-size: 10.5px;
        letter-spacing: 0.06em;
        padding: 8px 10px;
    }

    td {
        padding: 10px 10px;
    }

    .table-wrap table th:first-child,
    .table-wrap table td:first-child {
        position: sticky;
        left: 0;
        background: var(--surface);
    }

    .table-wrap table th:first-child {
        z-index: 2;
    }

    .table-wrap table td:first-child {
        z-index: 1;
    }

    .mobile-hide {
        display: none !important;
    }
}

@media print {
    .sidebar, .topbar, .toast-zone, .no-print {
        display: none !important;
    }

    .shell {
        margin: 0;
    }
}
