:root {
    color-scheme: dark;
}

body.cabinet-page {
    font-family: 'Inter', sans-serif;
    background-color: #05070a;
    color: #e2e8f0;
    overflow-x: hidden;
}

input,
select,
textarea,
button {
    color-scheme: dark;
}

.row-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s;
    align-items: stretch;
    min-height: 56px;
}

.row-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.icon-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-gradient {
    background: linear-gradient(90deg, #6366f1 0%, #a855f7 100%);
    transition: opacity 0.3s;
}

.btn-gradient:hover {
    opacity: 0.85;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    transition: all 0.3s;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

#offline-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #05070a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

#offline-screen.visible {
    display: flex;
}

#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-item {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    min-width: 260px;
}

.toast-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.toast-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.toast-info {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
}

.modal-box-wide {
    max-width: 700px;
    width: 95vw;
}

.cabinet-value-wrap {
    min-height: 56px;
    display: flex;
    align-items: center;
}

.cabinet-row {
    min-height: 56px;
}

.cabinet-label-cell,
.cabinet-value-cell,
.cabinet-action-button {
    min-height: 56px;
}

.cabinet-label-cell,
.cabinet-value-cell,
.cabinet-value-wrap,
.cabinet-input-wrap {
    display: flex;
    align-items: center;
}

.cabinet-value-cell {
    line-height: 1.2;
}

.cabinet-value-text {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
}

.cabinet-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    line-height: 1;
}

.cabinet-action-row {
    align-items: stretch;
}

.cabinet-action-button {
    align-self: stretch;
}

.cabinet-input-wrap input {
    line-height: 1.2;
}

#cab-role,
#cab-regdate,
#cab-sub,
#cab-sub-status {
    white-space: nowrap;
}

.users-table-scroll th,
.users-table-scroll td {
    vertical-align: middle;
}

.users-table-scroll tbody tr {
    height: 60px;
}

.modal-input-compact {
    padding-left: 14px !important;
    padding-right: 14px !important;
}

.version-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.version-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(13, 17, 23, 0.75);
    color: #e2e8f0;
    font-size: 13px;
}

.version-checkbox input {
    accent-color: #6366f1;
}

#user-versions-wrap.is-disabled {
    opacity: 0.55;
}

.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: rgba(148, 163, 184, 0.5);
    pointer-events: none;
    transition: color 0.2s;
}

.input-group:focus-within .input-icon {
    color: rgba(99, 102, 241, 0.8);
}

.input-group .input-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(148, 163, 184, 0.4);
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.input-group .input-eye:hover {
    color: rgba(148, 163, 184, 0.8);
}

.modal-input {
    width: 100% !important;
    background: rgba(13, 17, 23, 0.8) !important;
    background-color: rgba(13, 17, 23, 0.8) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    padding: 12px 44px 12px 44px !important;
    color: #e2e8f0 !important;
    font-size: 14px !important;
    font-family: 'Inter', sans-serif !important;
    outline: none !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(99, 102, 241, 0) !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    -webkit-text-fill-color: #e2e8f0 !important;
}

.modal-input:focus {
    border-color: rgba(99, 102, 241, 0.55) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}

.modal-input::placeholder {
    color: rgba(148, 163, 184, 0.4) !important;
}

.modal-input:-webkit-autofill,
.modal-input:-webkit-autofill:hover,
.modal-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px #0d1117 inset !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.modal-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.7);
    margin-bottom: 6px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.cabinet-hidden {
    display: none;
}

.admin-hidden {
    display: none;
}

.modal-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon-primary {
    font-size: 18px;
    color: #a5b4fc;
}

.modal-icon-sm {
    font-size: 18px;
}

.modal-icon-xs {
    font-size: 14px;
}

/* Password inputs without eye — less right padding */
.modal-input-no-eye {
    padding-right: 16px !important;
}

/* Scrollable users table */
.users-table-scroll {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.users-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.users-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.users-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.users-table-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Confirm modal danger variant */
.confirm-danger .modal-icon-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border-color: rgba(239, 68, 68, 0.3);
}

.confirm-danger .modal-icon-primary {
    color: #f87171;
}

.confirm-danger #btn-confirm-ok {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}
