:root {
    --bg: #0b1221;
    --card: #0f172a;
    --card-soft: #111c33;
    --card-strong: #0c1425;
    --text: #e8ecf4;
    --muted: #a7b7d5;
    --accent: #4cc9f0;
    --accent-strong: #1ea0ff;
    --danger: #ef4444;
    --border: #1f2a44;
    --success: #22c55e;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
    --radius: 16px;
    --transition: 0.2s ease;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at 12% 18%, rgba(76, 201, 240, 0.08), transparent 26%),
        radial-gradient(circle at 84% 6%, rgba(30, 160, 255, 0.07), transparent 32%),
        linear-gradient(120deg, #0b1221, #0e1830 65%, #0b1221);
    color: var(--text);
    min-height: 100vh;
}

.page-wrapper {
    max-width: 1260px;
    margin: 32px auto 56px;
    padding: 0 20px;
}

.hero-card {
    background: linear-gradient(120deg, rgba(76, 201, 240, 0.12), rgba(17, 24, 39, 0.4)), var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 38px;
    box-shadow: var(--shadow);
}

.hero-header-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.hero-text {
    max-width: 880px;
}

.hero-text h1 {
    margin: 8px 0 12px;
    font-size: 32px;
}

.hero-text p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(76, 201, 240, 0.25);
    background: rgba(76, 201, 240, 0.08);
    color: #c9e9ff;
    font-weight: 600;
    font-size: 13px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 18px;
    margin: 0;
}

.form-card {
    background: var(--card-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), var(--shadow);
}

.db-card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.75), rgba(11, 18, 33, 0.95)), var(--card-soft);
    border: 1px solid rgba(76, 201, 240, 0.18);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.28);
    width: 100%;
}

.form-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.db-card-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.db-card-description {
    color: var(--muted);
    margin: 6px 0 0;
    line-height: 1.55;
}

.db-helper-link {
    color: #7dd3fc;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.db-helper-link:hover {
    color: #bfe3ff;
}

.db-helper-cta {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(125, 211, 252, 0.2);
    border-radius: 14px;
    padding: 18px;
    margin: 16px 0 0;
    display: grid;
    gap: 12px;
}

.db-helper-cta.hidden {
    display: none;
}

.db-helper-cta p {
    margin: 0;
    line-height: 1.5;
    color: var(--muted);
}

.db-helper-button,
.db-helper-button-primary,
.db-helper-button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-size: 15px;
}

.db-helper-button {
    background: linear-gradient(135deg, #4cc9f0, #1ea0ff);
    color: #0b1829;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(30, 160, 255, 0.35);
}

.db-helper-button-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #0a1a0f;
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.3);
}

.db-helper-button-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.db-helper-button:hover,
.db-helper-button-primary:hover,
.db-helper-button-secondary:hover {
    transform: translateY(-1px);
}

.db-helper-button:active,
.db-helper-button-primary:active,
.db-helper-button-secondary:active {
    transform: translateY(0);
}

.db-helper-note {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.db-helper-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2000;
}

.db-helper-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.db-helper-modal {
    background: #0f172a;
    border-radius: 18px;
    width: min(520px, 94vw);
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(125, 211, 252, 0.18);
    color: #e2e8f0;
}

.db-helper-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.db-helper-modal-header h3 {
    margin: 0;
}

.db-helper-close {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 24px;
    cursor: pointer;
}

.db-helper-description {
    color: var(--muted);
    line-height: 1.6;
}

.db-helper-form {
    display: grid;
    gap: 12px;
    margin: 14px 0;
}

.db-helper-form label {
    display: block;
    margin-bottom: 6px;
    color: #cbd5e1;
}

.db-helper-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
}

.db-helper-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.db-helper-message {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    margin-top: 8px;
}

.db-helper-message.success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
    color: #bbf7d0;
}

.db-helper-message.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fecdd3;
}

.db-helper-success.hidden {
    display: none;
}

.db-helper-success h4 {
    margin: 0 0 8px;
}

.db-helper-credentials {
    display: grid;
    gap: 8px;
}

.db-helper-credential {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 10px 12px;
}

.db-helper-credential span {
    color: var(--muted);
    font-size: 14px;
}

.db-helper-credential code {
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 8px;
    border-radius: 8px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.db-helper-copy-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    color: #e2e8f0;
    cursor: pointer;
}

.db-helper-credential-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.db-helper-success-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.db-helper-toast {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: min(380px, 90vw);
    background: #0f172a;
    border: 1px solid rgba(125, 211, 252, 0.2);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
    transform: translateY(25px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 2100;
}

.db-helper-toast.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.db-helper-toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.db-helper-toast-title {
    font-weight: 700;
}

.db-helper-toast-close {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 20px;
    cursor: pointer;
}

.db-helper-toast-credentials {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.db-helper-toast-credential {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
}

.form-card-eyebrow {
    color: var(--muted);
    margin: 0;
    font-weight: 600;
}

.form-card h2 {
    margin: 6px 0;
}

.form-card p {
    margin: 0;
    color: var(--muted);
}

.form-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(76, 201, 240, 0.15);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 20px;
}

.db-card i,
.manager i,
.panel i,
.type-selector i,
.form-card i,
.db-helper-toast i {
    color: var(--accent);
}

.db-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.3), rgba(30, 160, 255, 0.3));
    color: var(--text);
    display: grid;
    place-items: center;
    font-size: 22px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 25px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(76, 201, 240, 0.35);
}

.db-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.db-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px 18px;
}

.db-form .full-width {
    grid-column: 1 / -1;
}

.db-form .grid-break {
    grid-column: 1 / -1;
    height: 0;
    margin: 0;
    padding: 0;
}

.input-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-with-icon i {
    color: var(--accent);
    font-size: 16px;
}

.input-with-icon:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.25);
    background: rgba(76, 201, 240, 0.06);
}

.input-with-icon input {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.input-with-icon input:focus {
    outline: none;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row-inline {
    display: grid;
    grid-template-columns: 1.6fr 0.6fr;
    gap: 10px;
    align-items: flex-end;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field-compact input {
    min-width: 120px;
}

.form-row label,
.form-field label {
    font-weight: 600;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row input,
.form-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text);
    font-size: 15px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-row input:focus,
.form-field input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.25);
    background: rgba(76, 201, 240, 0.06);
}

.form-hint {
    color: var(--muted);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
}

.remember-credentials {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
    margin: 2px 0 4px;
    justify-content: flex-start;
}

.remember-credentials input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

.remember-credentials label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    cursor: pointer;
}

.db-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    grid-column: 1 / -1;
    flex-wrap: wrap;
}

.db-card-footer .primary-button {
    margin-left: auto;
}

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    color: #c8f2d6;
    flex: 1;
    line-height: 1.5;
}

.security-note i {
    color: #34d399;
    margin-top: 2px;
}

.security-note strong {
    display: block;
    margin-bottom: 4px;
}

.primary-button,
.danger-button,
.ghost-button {
    border: none;
    border-radius: 12px;
    padding: 6px 16px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.primary-button {
    background: linear-gradient(120deg, var(--accent-strong), #22d3ee);
    color: #0b1221;
    box-shadow: 0 12px 30px rgba(30, 160, 255, 0.32);
}

.primary-button:hover {
    transform: translateY(-1px);
}

.primary-button.full-width {
    justify-content: center;
    width: 100%;
}

.form-actions {
    margin-top: 6px;
}

.form-footer-row {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: nowrap;
}

.form-footer-row .form-actions {
    flex: 1 1 0;
    min-width: 220px;
    margin-top: 0;
}

.form-footer-row .db-card-footer {
    margin-left: auto;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.form-actions .primary-button.main-action {
    width: 100%;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    padding: 14px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #4cc9f0, #1ea0ff);
    color: #0b1221;
    box-shadow: 0 18px 45px rgba(30, 160, 255, 0.38);
    border: none;
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.form-actions .primary-button.main-action .fas {
    font-size: 18px;
}

.form-actions .primary-button.main-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 50px rgba(30, 160, 255, 0.45);
}

.form-actions .primary-button.main-action:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 4px;
}

.db-submit {
    min-width: 180px;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border);
}

.ghost-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.danger-button {
    background: linear-gradient(120deg, #ef4444, #f97316);
    color: #0b1221;
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.22);
}

.alert {
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 600;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecdd3;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.manager {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.manager-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

.connection-info {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin-left: auto;
    justify-content: flex-end;
}

.connection-info p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

.type-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.type-chip {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.type-chip.active {
    background: rgba(76, 201, 240, 0.2);
    border-color: var(--accent);
    color: #e0f2fe;
    box-shadow: 0 10px 30px rgba(30, 160, 255, 0.25);
}

.status-line {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-line[data-tone="success"] {
    border-color: rgba(34, 197, 94, 0.4);
    color: #c0f8d0;
    background: rgba(34, 197, 94, 0.08);
}

.status-line[data-tone="error"] {
    border-color: rgba(239, 68, 68, 0.55);
    color: #fecdd3;
    background: rgba(239, 68, 68, 0.1);
}

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

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 440px;
}

.panel-header {
    padding: 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.select-all-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    position: relative;
}

.select-all-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.search-input {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    min-width: 210px;
}

.search-input i {
    color: var(--muted);
}

.search-input input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    width: 100%;
    font-size: 14px;
}

.search-input input::placeholder {
    color: var(--muted);
}

.panel-header h2 {
    margin: 6px 0 0;
}

.list {
    padding: 12px 16px 16px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list.scrollable {
    max-height: 540px;
    padding-right: 6px;
}

.list.scrollable::-webkit-scrollbar {
    width: 8px;
}

.list.scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.list.scrollable::-webkit-scrollbar-thumb {
    background: rgba(76, 201, 240, 0.35);
    border-radius: 8px;
}

.list-item {
    display: grid;
    grid-template-columns: auto auto 1fr minmax(120px, auto) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.list-item:hover {
    border-color: var(--accent);
    background: rgba(76, 201, 240, 0.08);
    transform: translateY(-1px);
}

.list-item.reorder-flash {
    animation: reorderFlash 1.2s ease;
}

.list-item.reorder-flash .item-name,
.list-item.reorder-flash .order-value {
    color: #fff;
}

.list-item.reorder-flash .checkbox,
.list-item.reorder-flash .item-actions .ghost-button {
    border-color: #72d0ff;
}

@keyframes reorderFlash {
    0% {
        background: rgba(149, 219, 255, 0.35);
        border-color: #4cc9f0;
    }
    50% {
        background: rgba(76, 201, 240, 0.15);
        transform: translateY(-4px);
    }
    100% {
        background: rgba(255, 255, 255, 0.02);
        border-color: var(--border);
        transform: translateY(0);
    }
}

.thumbnail-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
}

.item-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.item-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.thumbnail-fallback {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    padding: 0 6px;
    line-height: 1.2;
}

.item-thumbnail[data-has-image="true"] .thumbnail-fallback {
    opacity: 0;
}

.checkbox-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-body {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.list-body:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 12px;
}

.order-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    justify-content: center;
}

.order-value {
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.85rem;
    color: var(--muted);
}

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

.order-actions .order-button {
    padding: 6px 8px;
    font-size: 12px;
}

.order-actions .order-button i {
    font-size: 12px;
}

.item-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.item-actions .badge {
    margin: 0;
    flex-shrink: 0;
}

.list label {
    color: var(--text);
    display: flex;
    gap: 10px;
    cursor: pointer;
}

.checkbox {
    accent-color: var(--accent-strong);
    width: 18px;
    height: 18px;
}

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

.list .empty {
    text-align: center;
    color: var(--muted);
    margin: 40px 0;
}

.tag {
    background: rgba(76, 201, 240, 0.18);
    color: #e0f2fe;
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid rgba(76, 201, 240, 0.35);
}

.actions {
    display: flex;
    justify-content: flex-end;
}

.actions button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.badge {
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 10px;
    border-radius: 10px;
    color: var(--muted);
    border: 1px solid var(--border);
    font-weight: 600;
}

.ghost-button.compact {
    padding: 8px 10px;
    font-size: 13px;
    min-width: 0;
}

.list .active-row {
    border-color: var(--accent);
    background: rgba(76, 201, 240, 0.14);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(76, 201, 240, 0.12), transparent 32%),
        radial-gradient(circle at 80% 10%, rgba(239, 68, 68, 0.14), transparent 28%),
        rgba(4, 7, 17, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition), visibility var(--transition);
    z-index: 20;
    backdrop-filter: blur(8px);
}

.modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-dialog {
    position: relative;
    width: min(560px, 100%);
    background: linear-gradient(140deg, rgba(17, 24, 39, 0.9), rgba(15, 23, 42, 0.96));
    border: 1px solid rgba(76, 201, 240, 0.16);
    box-shadow: 0 24px 68px rgba(0, 0, 0, 0.5);
    border-radius: 18px;
    padding: 26px 26px 22px;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.28s ease, opacity 0.28s ease;
    opacity: 0;
}

.modal-dialog.edit-modal {
    width: min(480px, 100%);
    background: linear-gradient(145deg, rgba(9, 15, 31, 0.95), rgba(5, 10, 24, 0.95));
    border: 1px solid rgba(56, 189, 248, 0.24);
    box-shadow: 0 20px 60px rgba(7, 11, 20, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 28px 30px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    backdrop-filter: blur(12px);
}

.modal-backdrop.is-open .modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.modal-close:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(8deg);
}

.edit-modal-header {
    display: grid;
    gap: 8px;
    grid-template-columns: auto 1fr;
    align-items: center;
    margin-bottom: 8px;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fee2e2;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(249, 115, 22, 0.22));
    border: 1px solid rgba(239, 68, 68, 0.35);
    margin-bottom: 12px;
}

.modal-dialog h3 {
    margin: 6px 0 10px;
    font-size: 24px;
}

.modal-subtitle {
    color: var(--muted);
    margin: 0 0 18px;
    line-height: 1.5;
}

.modal-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.summary-card {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.summary-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.summary-number {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    color: #e0f2fe;
}

.summary-help {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.modal-warning {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    color: #fecdd3;
    margin: 0 0 18px;
}

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

.modal-icon.edit {
    width: 52px;
    height: 52px;
    background: linear-gradient(145deg, rgba(76, 201, 240, 0.16), rgba(30, 160, 255, 0.2));
    color: #c7e7ff;
    border-color: rgba(76, 201, 240, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.edit-modal-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-modal-copy .eyebrow {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.edit-modal-copy strong {
    color: #e0f2fe;
}

.edit-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-icon-field {
    display: grid;
    gap: 8px;
    align-items: flex-start;
}

.edit-icon-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.edit-modal-label {
    margin: 8px 0 4px;
    font-weight: 700;
    color: var(--muted);
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.input-shell i {
    color: var(--accent);
    font-size: 15px;
}

.input-shell input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    width: 100%;
    font-size: 15px;
}

.input-shell:focus-within {
    border-color: rgba(59, 130, 246, 0.65);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.08);
}

.edit-icon-preview {
    margin-top: 4px;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.55);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 8px;
    color: var(--muted);
    justify-self: flex-end;
}

.edit-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.edit-icon-preview span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    padding: 0 12px;
}

.edit-icon-preview.has-image span {
    opacity: 0;
}

.modal-actions.justify-start {
    justify-content: flex-start;
}

@media (max-width: 960px) {
    .form-row-inline {
        grid-template-columns: 1fr;
    }

    .modal-dialog {
        padding: 22px 18px;
    }
}
