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

body.theme-light {
    --bg-page: #f4f6f9;
    --bg-card: #ffffff;
    --bg-muted: #f8fafc;
    --bg-input: #ffffff;
    --bg-hover: #f8fafc;
    --text-primary: #1a1a2e;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-table-head: #475569;
    --border-color: #e2e8f0;
    --border-dashed: #cbd5e1;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.15);
    --btn-primary-bg: #1a1a2e;
    --btn-primary-hover: #2d2d4a;
    --btn-secondary-bg: #e2e8f0;
    --btn-secondary-hover: #cbd5e1;
    --btn-secondary-text: #1a1a2e;
    --action-color: #475569;
    --action-hover-bg: #e2e8f0;
    --action-hover-text: #1a1a2e;
    --modal-backdrop: rgba(15, 23, 42, 0.45);
    --tooltip-bg: #1a1a2e;
    --focus-ring: rgba(26, 26, 46, 0.1);
    --tab-active-bg: #ffffff;
    --tab-border: #e2e8f0;
    --auth-gradient: linear-gradient(145deg, #022c22 0%, #064e3b 28%, #065f46 52%, #042f2e 78%, #011a16 100%);
    --auth-orb-1: rgba(16, 185, 129, 0.28);
    --auth-orb-2: rgba(5, 150, 105, 0.22);
    --auth-orb-3: rgba(4, 120, 87, 0.32);
    --modal-field-label-bg: #ffffff;
}

body.theme-dark {
    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --bg-muted: #334155;
    --bg-input: #0f172a;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-table-head: #cbd5e1;
    --border-color: #334155;
    --border-dashed: #475569;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.5);
    --btn-primary-bg: #3b82f6;
    --btn-primary-hover: #2563eb;
    --btn-secondary-bg: #334155;
    --btn-secondary-hover: #475569;
    --btn-secondary-text: #f1f5f9;
    --action-color: #94a3b8;
    --action-hover-bg: #334155;
    --action-hover-text: #f1f5f9;
    --modal-backdrop: rgba(0, 0, 0, 0.6);
    --tooltip-bg: #0f172a;
    --focus-ring: rgba(59, 130, 246, 0.25);
    --tab-active-bg: #1e293b;
    --tab-border: #334155;
    --auth-gradient: linear-gradient(145deg, #011a16 0%, #022c22 25%, #0f172a 50%, #064e3b 75%, #011a16 100%);
    --auth-orb-1: rgba(16, 185, 129, 0.2);
    --auth-orb-2: rgba(52, 211, 153, 0.14);
    --auth-orb-3: rgba(4, 120, 87, 0.28);
    --modal-field-label-bg: #1e293b;
}

body {
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    transition: background 0.2s, color 0.2s;
}

body:not(.auth-page) {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

body.modal-open {
    overflow: hidden;
}

.layout {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.layout-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.mobile-topbar {
    display: none;
}

.nav-toggle-input {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1090;
    margin: 0;
    background: var(--modal-backdrop);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

#navToggle:checked ~ .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 2rem;
}

.sidebar {
    width: 240px;
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: transparent;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-body-size, var(--font-body-size, 14px));
    font-weight: 400;
}

.sidebar-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--auth-gradient);
    overflow: hidden;
    pointer-events: none;
}

.sidebar-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 10%, rgba(52, 211, 153, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(4, 120, 87, 0.22) 0%, transparent 48%);
}

.sidebar-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(1, 20, 16, 0.62);
}

body.theme-dark .sidebar-bg::before {
    background:
        radial-gradient(circle at 15% 10%, rgba(52, 211, 153, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(16, 185, 129, 0.12) 0%, transparent 48%);
}

.sidebar-bg .auth-orb {
    filter: blur(70px);
    opacity: 0.65;
}

.sidebar-bg .auth-orb--1 {
    width: 220px;
    height: 220px;
    top: -90px;
    left: -70px;
}

.sidebar-bg .auth-orb--2 {
    width: 180px;
    height: 180px;
    right: -70px;
    top: 28%;
}

.sidebar-bg .auth-orb--3 {
    width: 160px;
    height: 160px;
    bottom: -70px;
    left: 10%;
}

.sidebar > :not(.sidebar-bg) {
    position: relative;
    z-index: 1;
}

.sidebar,
.sidebar .brand-company,
.sidebar .sidebar-link,
.sidebar .sidebar-user {
    color: rgba(255, 255, 255, 0.92);
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand.brand-head {
    text-align: center;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.sidebar-brand--with-company .sidebar-brand-row {
    justify-content: flex-start;
}

.sidebar-brand .brand-logo,
.sidebar-brand-mark {
    width: 40px;
    height: 40px;
    margin-bottom: 0;
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar-brand-mark.brand-mark--letter,
.sidebar-brand .brand-logo.brand-mark--letter {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #fff;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: calc(var(--sidebar-font-title-size, var(--font-title-size, 14px)) + 2px);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.sidebar-brand-mark.brand-mark--image,
.sidebar-brand .brand-logo.brand-mark--image {
    padding: 0.2rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.sidebar-brand-company,
.sidebar .brand-company {
    margin-bottom: 0;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-nav {
    padding: 0.625rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
}

.sidebar-nav .sidebar-link,
.sidebar-nav .sidebar-nav-btn {
    display: block;
    width: 100%;
    padding: 0.375rem 0.875rem;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    border: none;
    border-radius: 6px;
    border-left: 3px solid transparent;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-body-size, var(--font-body-size, 14px));
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    scroll-margin-block: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-nav .sidebar-link:not(.active):hover,
.sidebar-nav .sidebar-link:not(.active):focus,
.sidebar-nav .sidebar-link:not(.active):focus-visible,
.sidebar-nav .sidebar-nav-btn:not(.active):hover,
.sidebar-nav .sidebar-nav-btn:not(.active):focus,
.sidebar-nav .sidebar-nav-btn:not(.active):focus-visible {
    background: transparent;
    border-left-color: transparent;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
    outline: none;
}

.sidebar-nav .sidebar-link.active,
.sidebar-nav .sidebar-link.active:hover,
.sidebar-nav .sidebar-link.active:focus-visible,
.sidebar-nav .sidebar-nav-btn.active,
.sidebar-nav .sidebar-nav-btn.active:hover,
.sidebar-nav .sidebar-nav-btn.active:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-left-color: rgba(52, 211, 153, 0.95);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    outline: none;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-group-toggle-label {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.sidebar-group-chevron {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    color: rgba(255, 255, 255, 0.55);
    transition: transform 0.2s ease, color 0.15s ease;
}

.sidebar-group--open .sidebar-group-chevron {
    transform: rotate(90deg);
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-group--active .sidebar-group-toggle,
.sidebar-group--open .sidebar-group-toggle {
    color: #fff;
}

.sidebar-group-items {
    display: none;
    flex-direction: column;
    gap: 0.125rem;
    padding-left: 0.25rem;
}

.sidebar-group--open .sidebar-group-items {
    display: flex;
}

.sidebar-sublink {
    padding-left: 1.35rem;
    font-size: calc(var(--sidebar-font-body-size, var(--font-body-size, 14px)) - 1px);
}

.sidebar-link {
    display: block;
    text-decoration: none;
    font-size: var(--font-body-size, 14px);
    line-height: 1.25;
    scroll-margin-block: 0;
    color: rgba(255, 255, 255, 0.88);
}

.sidebar-link-muted {
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding-top: 1rem;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 0.3125rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(1, 20, 16, 0.82);
}

.sidebar-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    min-height: 24px;
}

.sidebar-footer form {
    margin: 0;
    display: flex;
    flex-shrink: 0;
}

.sidebar-user {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0;
    line-height: 1;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    font-weight: 400;
    color: rgba(255, 255, 255, 0.68);
    letter-spacing: 0.01em;
}

.sidebar-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    transition: background 0.15s, color 0.15s;
}

.sidebar-logout-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.sidebar-logout-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.sidebar-logout-btn.action-btn {
    width: 32px;
    height: 32px;
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

.sidebar-logout-btn.action-btn:hover {
    background: rgba(248, 113, 113, 0.34);
    color: #fff;
    box-shadow: none;
    transform: none;
}

.sidebar-logout-btn.action-btn svg {
    width: 16px;
    height: 16px;
}

.sidebar-footer .sidebar-link {
    padding: 0.25rem 0.5rem;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    font-weight: 400;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    padding: 2rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-brand .page-title {
    margin-bottom: 0.375rem;
}

.login-btn {
    width: 100%;
}

/* Auth login page */
.brand-mark--letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.brand-mark--image {
    display: block;
    object-fit: contain;
}

.auth-page {
    min-height: 100vh;
    overflow: hidden;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
}

body.theme-light.auth-page {
    --auth-panel-bg: rgba(255, 255, 255, 0.94);
    --auth-panel-border: rgba(255, 255, 255, 0.12);
    --auth-panel-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(16, 185, 129, 0.15);
    --auth-field-label-bg: rgba(255, 255, 255, 0.94);
}

body.theme-dark.auth-page {
    --auth-panel-bg: rgba(15, 28, 24, 0.9);
    --auth-panel-border: rgba(52, 211, 153, 0.14);
    --auth-panel-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(16, 185, 129, 0.12);
    --auth-field-label-bg: rgba(15, 28, 24, 0.9);
}

.auth-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--auth-gradient);
    overflow: hidden;
}

.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 10%, rgba(52, 211, 153, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(4, 120, 87, 0.22) 0%, transparent 48%);
    pointer-events: none;
}

body.theme-dark.auth-page .auth-bg::before {
    background:
        radial-gradient(circle at 15% 10%, rgba(52, 211, 153, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(16, 185, 129, 0.12) 0%, transparent 48%);
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    animation: auth-float 18s ease-in-out infinite;
    opacity: 0.95;
}

.auth-orb--1 {
    width: 480px;
    height: 480px;
    top: -120px;
    left: -80px;
    background: var(--auth-orb-1);
}

.auth-orb--2 {
    width: 420px;
    height: 420px;
    right: -100px;
    top: 20%;
    background: var(--auth-orb-2);
    animation-delay: -6s;
}

.auth-orb--3 {
    width: 360px;
    height: 360px;
    bottom: -100px;
    left: 35%;
    background: var(--auth-orb-3);
    animation-delay: -12s;
}

@keyframes auth-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(24px, -18px) scale(1.04); }
    66% { transform: translate(-16px, 12px) scale(0.96); }
}

.auth-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 2.25rem 2rem 1.75rem;
    border-radius: 24px;
    background: var(--auth-panel-bg);
    border: 1px solid var(--auth-panel-border);
    box-shadow: var(--auth-panel-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: auth-panel-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.auth-panel-head {
    text-align: center;
    margin-bottom: 2rem;
}

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

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 18px;
    background: var(--btn-primary-bg);
    color: #fff;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: calc(var(--font-title-size, 14px) + 6px);
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(26, 26, 46, 0.2);
}

.brand-logo.brand-mark--image {
    padding: 0.45rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.brand-company {
    margin-bottom: 0.35rem;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.brand-name {
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: calc(var(--font-title-size, 14px) + 10px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-version {
    margin-top: 0.35rem;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.brand-tagline {
    margin-top: 0.5rem;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    line-height: 1.55;
    color: var(--text-muted);
}

.auth-panel-head .brand-logo,
.auth-panel-head .auth-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 18px;
}

.auth-logo.brand-mark--letter,
.brand-logo.brand-mark--letter {
    background: var(--btn-primary-bg);
    color: #fff;
    box-shadow: 0 12px 28px rgba(26, 26, 46, 0.2);
}

.auth-logo.brand-mark--image,
.brand-logo.brand-mark--image {
    padding: 0.45rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.auth-company,
.auth-system-name,
.auth-version,
.auth-tagline {
    margin-left: auto;
    margin-right: auto;
}

.auth-company {
    margin-bottom: 0.35rem;
}

.auth-system-name {
    font-size: calc(var(--font-title-size, 14px) + 10px);
}

.auth-version {
    margin-top: 0.35rem;
}

.auth-tagline {
    margin-top: 0.5rem;
}

.auth-company { color: var(--text-muted); }
.auth-system-name { color: var(--text-primary); }
.auth-version { color: var(--text-muted); }
.auth-tagline { color: var(--text-muted); }

.auth-form {
    display: grid;
    gap: 1.25rem;
}

.auth-field--outlined .auth-input-wrap {
    position: relative;
}

.auth-field--outlined label {
    position: absolute;
    left: 2.55rem;
    top: 50%;
    z-index: 1;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 700;
    color: var(--text-muted);
    background: var(--auth-field-label-bg, var(--bg-input));
    padding: 0 0.3rem;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
    transition: top 0.18s ease, left 0.18s ease, font-size 0.18s ease, color 0.18s ease;
}

.auth-field--outlined .auth-input:focus + label,
.auth-field--outlined .auth-input:not(:placeholder-shown) + label,
.auth-field--outlined .auth-input:-webkit-autofill + label,
.auth-field--outlined .auth-input:autofill + label,
.auth-field--outlined .auth-input.is-filled + label {
    top: 0;
    left: 2.25rem;
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--btn-primary-bg);
}

@keyframes auth-autofill-start {
    from {
        opacity: 1;
    }

    to {
        opacity: 1;
    }
}

.auth-input:-webkit-autofill {
    animation-name: auth-autofill-start;
    animation-duration: 0.001s;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
    transition: background-color 99999s ease-out 0s;
}

.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-card) inset !important;
}

.auth-input:-moz-autofill,
.auth-input:-moz-autofill-preview {
    filter: none;
    box-shadow: 0 0 0 1000px var(--bg-input) inset;
    -moz-text-fill-color: var(--text-primary);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    display: inline-flex;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input {
    width: 100%;
    min-height: 52px;
    padding: 1.15rem 0.875rem 0.55rem 2.65rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input::placeholder {
    color: transparent;
}

.auth-input:hover {
    border-color: var(--border-dashed);
}

.auth-input:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 4px var(--focus-ring);
    background: var(--bg-card);
}

.auth-field--outlined .auth-input:focus + label {
    background: var(--auth-field-label-bg, var(--bg-card));
}

.auth-field--outlined .auth-input:-webkit-autofill + label,
.auth-field--outlined .auth-input:autofill + label,
.auth-field--outlined .auth-input.is-filled + label {
    background: var(--auth-field-label-bg, var(--bg-input));
}

.auth-field--outlined .auth-input:-webkit-autofill:focus + label,
.auth-field--outlined .auth-input.is-filled:focus + label {
    background: var(--auth-field-label-bg, var(--bg-card));
}

.auth-password-field .auth-input-wrap .auth-input {
    padding-right: 2.75rem;
}

.auth-password-field .password-toggle {
    right: 0.5rem;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
    margin-top: 0.5rem;
    border-radius: 12px;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.theme-dark .auth-submit {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.32);
}

.auth-submit:hover {
    transform: translateY(-1px);
}

.auth-submit svg {
    transition: transform 0.15s ease;
}

.auth-submit:hover svg {
    transform: translateX(3px);
}

.auth-footer {
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-sub-size, 13px);
    font-weight: 400;
    color: var(--text-muted);
}

.auth-license {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.auth-license-badge {
    display: inline-block;
}

.auth-license-detail {
    margin: 0;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-sub-size, 13px);
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.45;
}

.main-content--dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cron-reconcile-card {
    margin-top: 0;
}

.cron-reconcile-card .dashboard-cron-head {
    margin-bottom: 0.75rem;
}

.cron-reconcile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 0.75rem;
}

.cron-reconcile-action-btn {
    border: 1px solid var(--border-color, #d1d5db);
    background: var(--surface-muted, #f3f4f6);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-size: var(--font-body-size, 14px);
    font-weight: 600;
    cursor: pointer;
}

.cron-reconcile-action-btn:hover:not(:disabled) {
    background: var(--surface-hover, #e5e7eb);
}

.cron-reconcile-action-btn--primary {
    background: var(--primary, #008cca);
    border-color: var(--primary, #008cca);
    color: #fff;
}

.cron-reconcile-action-btn--primary:hover:not(:disabled) {
    background: #007ab5;
}

.cron-reconcile-action-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.cron-reconcile-status {
    margin: 0 0 1rem;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-secondary);
    line-height: 1.5;
}

.cron-reconcile-status--error {
    color: #b91c1c;
}

.cron-reconcile-jobs-wrap {
    margin-bottom: 1rem;
}

.cron-reconcile-jobs-list {
    max-height: 280px;
    overflow: auto;
    white-space: pre-wrap;
}

.cron-reconcile-job-line {
    display: block;
}

.cron-reconcile-job-line--hsqr {
    color: #86efac;
    font-weight: 700;
}

.dashboard-cron-card {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 12px;
    background: var(--surface-card, #fff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.dashboard-cron-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.dashboard-cron-title {
    margin: 0;
    font-size: var(--font-title-size, 14px);
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-cron-job-id {
    font-size: 11px;
    letter-spacing: 0.03em;
}

.dashboard-cron-lead {
    margin: 0 0 1rem;
    font-size: var(--font-body-size, 14px);
    line-height: 1.55;
    color: var(--text-secondary);
}

.dashboard-cron-warning {
    margin: 0;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    background: #fff8e6;
    border: 1px solid #f59e0b;
    color: #92400e;
    font-size: var(--font-sub-size, 13px);
}

.dashboard-cron-meta {
    margin: 0 0 1rem;
    display: grid;
    gap: 0.45rem;
}

.dashboard-cron-meta-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.75rem;
    align-items: start;
}

.dashboard-cron-meta-row dt {
    margin: 0;
    font-size: var(--font-sub-size, 13px);
    font-weight: 600;
    color: var(--text-muted);
}

.dashboard-cron-meta-row dd {
    margin: 0;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-primary);
    word-break: break-word;
}

.dashboard-cron-block {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.dashboard-cron-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.dashboard-cron-block-title {
    margin: 0;
    font-size: var(--font-body-size, 14px);
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-cron-copy {
    border: 1px solid var(--border-color, #d1d5db);
    background: var(--surface-muted, #f3f4f6);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.dashboard-cron-copy:hover {
    background: var(--surface-hover, #e5e7eb);
}

.dashboard-cron-command {
    margin: 0;
    padding: 0.85rem 0.9rem;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.dashboard-cron-command--wrap {
    white-space: pre-wrap;
}

.dashboard-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    text-align: center;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-muted);
}

.dashboard-footer-line {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.4rem;
}

.dashboard-footer-sep {
    margin: 0 0.4rem;
    color: var(--border-dashed);
}

.dashboard-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.dashboard-footer a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.dashboard-footer-link {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dashboard-footer-link:hover {
    color: var(--text-primary);
}

.modal-dialog--license-extend {
    max-width: 480px;
}

.license-extend-current {
    margin: 0 0 1rem;
    font-size: var(--font-body-size, 14px);
    color: var(--text-secondary);
}

.license-extend-summary {
    margin: 0 0 1rem;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-muted);
}

.license-extend-summary-sep {
    margin: 0 0.35rem;
}

.license-qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 1.25rem;
    border: 1px dashed var(--border-dashed);
    border-radius: 8px;
    background: var(--bg-muted);
    text-align: center;
}

.license-qr-box--active {
    border-style: solid;
    border-color: var(--border-color);
    background: var(--bg-card);
}

.license-qr-empty {
    margin: 0;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-muted);
}

.license-qr-image {
    display: block;
    width: min(100%, 280px);
    height: auto;
    border-radius: 8px;
    background: #fff;
    padding: 0.75rem;
}

.license-qr-countdown {
    margin: 0.75rem 0 0;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-muted);
}

.license-qr-countdown strong {
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.license-qr-countdown--warning strong {
    color: #d97706;
}

.license-qr-status {
    margin: 0.75rem 0 0;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-muted);
    text-align: center;
    line-height: 1.45;
}

.license-qr-status--error {
    color: #dc2626;
}

.license-qr-status--success {
    color: var(--btn-primary-bg);
}

body.theme-dark .license-qr-countdown--warning strong {
    color: #fbbf24;
}

body.theme-dark .license-qr-status--error {
    color: #f87171;
}

.portal-support-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.portal-support-link:hover {
    opacity: 0.85;
}

.router-test-status {
    margin: 0;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-muted);
    line-height: 1.45;
}

.router-test-status--error {
    color: #dc2626;
}

.router-test-status--success {
    color: var(--btn-primary-bg);
}

.router-test-status--pending {
    color: var(--text-muted);
}

body.theme-dark .router-test-status--error {
    color: #f87171;
}

.text-error {
    color: #dc2626;
}

body.theme-dark .text-error {
    color: #f87171;
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.content-section + .content-section {
    margin-top: 2rem;
}

.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-toolbar .settings-section-title {
    margin: 0;
}

.section-toolbar--wrap {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
}

.hs-profiles-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.hs-profiles-toolbar .modal-field {
    margin: 0;
    min-width: min(100%, 240px);
}

.hs-profiles-status {
    margin: 0 0 1rem;
}

.hs-profiles-status--error {
    color: #dc2626;
}

.hs-profiles-status--success {
    color: var(--btn-primary-bg);
}

body.theme-dark .hs-profiles-status--error {
    color: #f87171;
}

.module-checkbox-grid {
    display: grid;
    gap: 0.5rem;
}

.module-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.module-checkbox input {
    margin: 0;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 700;
    color: var(--text-primary);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.welcome-text,
.page-title,
.modal-title,
.data-table th {
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-title-size, 14px);
    font-weight: 700;
    color: var(--text-primary);
}

.welcome-text,
.page-title {
    margin-bottom: 0;
}

.page-header .page-title {
    margin-bottom: 0;
}

.text-body {
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    color: var(--text-primary);
}

.text-sub,
.empty-state,
.data-table td,
.form-hint,
.badge,
.toast {
    font-size: var(--font-sub-size, 13px);
    font-weight: 400;
}

.empty-state {
    color: var(--text-muted);
}

.table-wrap {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table th {
    background: var(--bg-muted);
    color: var(--text-table-head);
    white-space: nowrap;
}

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

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    text-transform: capitalize;
}

.badge-role {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-superadmin {
    background: #fef3c7;
    color: #92400e;
    text-transform: capitalize;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.badge-default {
    background: rgba(52, 211, 153, 0.18);
    color: #059669;
}

body.theme-dark .badge-default {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 12px;
    line-height: 1.2;
}

.table-inline-form {
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: none;
    border-radius: 6px;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: #fff;
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover);
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: var(--action-hover-bg);
    color: var(--action-color);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
    flex: 0 0 auto;
}

.action-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.action-btn.add,
.action-btn.save {
    color: #047857;
    background: #d1fae5;
}

.action-btn.add:hover,
.action-btn.save:hover {
    color: #065f46;
    background: #a7f3d0;
}

.action-btn.edit,
.action-btn.refresh {
    color: #1d4ed8;
    background: #dbeafe;
}

.action-btn.edit:hover,
.action-btn.refresh:hover {
    color: #1e3a8a;
    background: #bfdbfe;
}

.action-btn.delete,
.action-btn.danger,
.action-btn.logout {
    color: #dc2626;
    background: #fee2e2;
}

.action-btn.delete:hover,
.action-btn.danger:hover,
.action-btn.logout:hover {
    color: #991b1b;
    background: #fecaca;
}

.action-btn.cancel,
.action-btn.close,
.action-btn.secondary {
    color: #475569;
    background: #e2e8f0;
}

.action-btn.cancel:hover,
.action-btn.close:hover,
.action-btn.secondary:hover {
    color: #1e293b;
    background: #cbd5e1;
}

.action-btn.test {
    color: #b45309;
    background: #fef3c7;
}

.action-btn.test:hover {
    color: #92400e;
    background: #fde68a;
}

.action-btn.default {
    color: #7c3aed;
    background: #ede9fe;
}

.action-btn.default:hover {
    color: #5b21b6;
    background: #ddd6fe;
}

.action-btn.settings {
    color: #0f766e;
    background: #ccfbf1;
}

.action-btn.settings:hover {
    color: #115e59;
    background: #99f6e4;
}

.action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

body.theme-dark .action-btn.add,
body.theme-dark .action-btn.save {
    color: #6ee7b7;
    background: #064e3b;
}

body.theme-dark .action-btn.edit,
body.theme-dark .action-btn.refresh {
    color: #93c5fd;
    background: #1e3a5f;
}

body.theme-dark .action-btn.delete,
body.theme-dark .action-btn.danger,
body.theme-dark .action-btn.logout {
    color: #fca5a5;
    background: #450a0a;
}

body.theme-dark .action-btn.cancel,
body.theme-dark .action-btn.close,
body.theme-dark .action-btn.secondary {
    color: #cbd5e1;
    background: #334155;
}

body.theme-dark .action-btn.test {
    color: #fcd34d;
    background: #78350f;
}

body.theme-dark .action-btn.default {
    color: #c4b5fd;
    background: #4c1d95;
}

body.theme-dark .action-btn.settings {
    color: #5eead4;
    background: #134e4a;
}

.action-btn.is-loading {
    opacity: 0.65;
    cursor: wait;
}

.action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.25rem 0.5rem;
    background: var(--tooltip-bg);
    color: #fff;
    font-size: var(--font-sub-size, 13px);
    font-weight: 400;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 10;
}

.action-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toolbar-icon-actions,
.modal-footer--icons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-toolbar .toolbar-icon-actions {
    margin-left: auto;
}

.table-inline-form {
    margin: 0;
    display: inline-flex;
}

.modal-close.action-btn {
    width: 34px;
    height: 34px;
    font-size: 0;
}

.modal-close.action-btn svg {
    width: 18px;
    height: 18px;
}

.settings-card,
.form-card {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    max-width: 520px;
}

.settings-card-wide {
    max-width: 560px;
}

.settings-page .settings-card {
    max-width: none;
    width: 100%;
}

.setup-card {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    max-width: 520px;
    display: grid;
    gap: 0.75rem;
}

.settings-tabs {
    display: flex;
    gap: 0.25rem;
    margin: -0.25rem -0.25rem 1.25rem;
    padding-bottom: 0;
    border-bottom: 1px solid var(--tab-border);
}

.settings-tab {
    padding: 0.625rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

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

.settings-tab.active {
    color: var(--text-primary);
    font-weight: 700;
    border-bottom-color: var(--btn-primary-bg);
    background: var(--tab-active-bg);
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: grid;
    gap: 1rem;
}

.settings-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: -0.25rem;
}

.settings-subtab {
    padding: 0.4375rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-muted);
    color: var(--text-muted);
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-sub-size, 13px);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.settings-subtab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.settings-subtab.active {
    color: var(--text-primary);
    font-weight: 700;
    background: var(--tab-active-bg);
    border-color: var(--btn-primary-bg);
}

.settings-subtab-panel {
    display: none;
    gap: 1rem;
}

.settings-subtab-panel.active {
    display: grid;
}

.settings-section-title {
    font-size: var(--font-title-size, 14px);
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text-primary);
}

.settings-defaults-note {
    margin-top: -0.25rem;
    line-height: 1.5;
}

.settings-subsection {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
}

.settings-subsection .settings-section-title {
    font-size: calc(var(--font-title-size, 14px) + 0px);
}

.sidebar-typography-preview-surface {
    padding: 0.875rem;
    border-radius: 6px;
    background: linear-gradient(145deg, #022c22 0%, #064e3b 52%, #011a16 100%);
    color: #fff;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
}

.sidebar-preview-brand {
    margin-bottom: 0.625rem;
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.sidebar-preview-link {
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.125rem;
    font-size: var(--sidebar-font-body-size, var(--font-body-size, 14px));
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-preview-link-active {
    padding: 0.25rem 0.5rem;
    border-left: 3px solid rgba(52, 211, 153, 0.95);
    background: rgba(255, 255, 255, 0.12);
    font-weight: 700;
    color: #fff;
}

.sidebar-preview-user {
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    color: rgba(255, 255, 255, 0.68);
}

.settings-restore-box {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 1rem;
    border: 1px dashed var(--border-dashed);
    border-radius: 6px;
    background: var(--bg-muted);
}

.settings-restore-box .settings-section-title {
    font-size: calc(var(--font-title-size, 14px) + 0px);
}

.licensing-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.licensing-preview .settings-preview-body {
    margin-bottom: 0.375rem;
}

.settings-preview,
.theme-preview {
    margin-top: 0.5rem;
}

.settings-preview,
.theme-preview-surface {
    padding: 1rem;
    border: 1px dashed var(--border-dashed);
    border-radius: 6px;
    background: var(--bg-muted);
}

.theme-preview-surface {
    border-style: solid;
    border-color: var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.theme-preview-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.settings-preview-title {
    font-size: var(--font-sub-size, 13px);
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.settings-preview-header {
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-title-size, 14px);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.settings-preview-body {
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.settings-preview-sub {
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    font-weight: 400;
    color: var(--text-muted);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: var(--font-body-size, 14px);
    font-weight: 700;
    color: var(--text-secondary);
}

.form-group input:not(.settings-input),
.form-group select:not(.settings-input),
.form-group textarea:not(.settings-input),
.settings-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-dashed);
    border-radius: 6px;
    font-family: var(--sidebar-font-family, var(--font-family, 'Segoe UI', system-ui, sans-serif));
    font-size: var(--sidebar-font-sub-size, var(--font-sub-size, 13px));
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-input);
    width: 100%;
}

.form-group input:not(.settings-input):focus,
.form-group select:not(.settings-input):focus,
.form-group textarea:not(.settings-input):focus,
.settings-select:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.password-toggle:focus {
    outline: none;
    color: var(--text-secondary);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.password-toggle .icon-eye-closed {
    display: none;
}

.password-toggle.is-visible .icon-eye-open {
    display: none;
}

.password-toggle.is-visible .icon-eye-closed {
    display: block;
}

.form-hint {
    color: var(--text-muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.branding-logo-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-muted);
}

.branding-logo-preview-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-card);
    padding: 0.35rem;
}

.branding-remove-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-secondary);
    cursor: pointer;
}

.branding-preview-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.branding-preview-mark.brand-mark--image,
.branding-preview-mark.brand-mark--letter {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
}

.branding-preview-mark.brand-mark--letter {
    background: var(--btn-primary-bg);
    color: #fff;
    font-size: 1.25rem;
}

.branding-preview-mark.brand-mark--image {
    padding: 0.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.branding-preview-company {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.branding-preview-system {
    font-size: calc(var(--font-title-size, 14px) + 2px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.branding-preview-version {
    font-size: var(--font-sub-size, 13px);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.branding-preview-description {
    font-size: var(--font-sub-size, 13px);
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.inline-form {
    margin: 0;
}

.db-config-summary .form-group p {
    margin: 0;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.25rem 0;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--modal-backdrop);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-modal);
    z-index: 1;
    transform: translateY(12px);
    transition: transform 0.2s;
}

.modal.open .modal-dialog {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.modal-footer--icons {
    justify-content: flex-end;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-field--outlined .modal-input-wrap {
    position: relative;
}

.modal-field--has-help {
    position: relative;
    padding-right: 2rem;
}

.field-help-btn {
    position: absolute;
    top: 0.55rem;
    right: 0;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--btn-primary-bg) 35%, var(--border-color));
    border-radius: 999px;
    background: color-mix(in srgb, var(--btn-primary-bg) 10%, var(--bg-card));
    color: var(--btn-primary-bg);
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.field-help-btn:hover,
.field-help-btn:focus-visible {
    background: var(--btn-primary-bg);
    border-color: var(--btn-primary-bg);
    color: #fff;
    transform: scale(1.05);
    outline: none;
}

.modal-dialog--field-help {
    max-width: 28rem;
}

.field-help-text {
    margin: 0;
    line-height: 1.55;
}

.field-help-example {
    margin-top: 1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--btn-primary-bg) 8%, var(--bg-card));
    border: 1px solid color-mix(in srgb, var(--btn-primary-bg) 18%, var(--border-color));
}

.field-help-example-label {
    margin: 0 0 0.35rem;
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--btn-primary-bg);
}

.field-help-example-value {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--font-body-size, 14px);
    line-height: 1.45;
    color: var(--text-primary);
    word-break: break-word;
}

.modal-field--outlined label {
    position: absolute;
    left: 2.55rem;
    top: 50%;
    z-index: 1;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 700;
    color: var(--text-muted);
    background: var(--modal-field-label-bg, var(--bg-card));
    padding: 0 0.3rem;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
    transition: top 0.18s ease, left 0.18s ease, font-size 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.modal-field--outlined .modal-input:focus + label,
.modal-field--outlined .modal-input:not(:placeholder-shown) + label,
.modal-field--outlined .modal-input:-webkit-autofill + label,
.modal-field--outlined .modal-input:autofill + label,
.modal-field--outlined .modal-input.is-filled + label {
    top: 0;
    left: 2.25rem;
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--btn-primary-bg);
}

.modal-field--outlined .modal-input:read-only,
.modal-field--outlined .modal-input.is-readonly {
    cursor: not-allowed;
    opacity: 0.85;
    background: color-mix(in srgb, var(--surface-elevated, #f5f5f5) 88%, transparent);
}

.modal-input-wrap {
    position: relative;
}

.modal-input-icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    display: inline-flex;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.modal-input-icon--currency {
    font-size: calc(var(--font-body-size, 14px) + 2px);
    font-weight: 700;
    line-height: 1;
}

.modal-input {
    width: 100%;
    min-height: 52px;
    padding: 1.15rem 0.875rem 0.55rem 2.65rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.modal-input::placeholder {
    color: transparent;
}

.modal-input:hover {
    border-color: var(--border-dashed);
}

.modal-input:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 4px var(--focus-ring);
    background: var(--bg-card);
}

.modal-field--outlined .modal-input:focus + label {
    background: var(--modal-field-label-bg, var(--bg-card));
}

.modal-field--outlined .modal-input:-webkit-autofill + label,
.modal-field--outlined .modal-input:autofill + label,
.modal-field--outlined .modal-input.is-filled + label {
    background: var(--modal-field-label-bg, var(--bg-input));
}

.modal-field--outlined .modal-input:-webkit-autofill:focus + label,
.modal-field--outlined .modal-input.is-filled:focus + label {
    background: var(--modal-field-label-bg, var(--bg-card));
}

.modal-input:-webkit-autofill {
    animation-name: auth-autofill-start;
    animation-duration: 0.001s;
}

.modal-input:-webkit-autofill,
.modal-input:-webkit-autofill:hover,
.modal-input:-webkit-autofill:focus,
.modal-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
    transition: background-color 99999s ease-out 0s;
}

.modal-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-card) inset !important;
}

.modal-password-field .modal-input-wrap .modal-input {
    padding-right: 2.75rem;
}

.modal-password-field .password-toggle {
    right: 0.5rem;
}

.modal-field--outlined .modal-input--select + label {
    top: 0;
    left: 2.25rem;
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--btn-primary-bg);
    background: var(--modal-field-label-bg, var(--bg-card));
}

.modal-field--outlined .modal-input--select:focus + label {
    background: var(--modal-field-label-bg, var(--bg-card));
}

.modal-input--select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.75rem;
    cursor: pointer;
}

.modal-input-wrap--select::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.modal-body .modal-field--outlined + .form-hint,
.modal-body .modal-field--outlined + .license-extend-summary {
    margin-top: 0.5rem;
}

.settings-field--outlined .settings-input-wrap {
    position: relative;
}

.settings-field--outlined label {
    position: absolute;
    left: 2.55rem;
    top: 50%;
    z-index: 1;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 700;
    color: var(--text-muted);
    background: var(--settings-field-label-bg, var(--bg-input));
    padding: 0 0.3rem;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
    transition: top 0.18s ease, left 0.18s ease, font-size 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.settings-field--outlined .settings-input:focus + label,
.settings-field--outlined .settings-input:not(:placeholder-shown) + label,
.settings-field--outlined .settings-input:-webkit-autofill + label,
.settings-field--outlined .settings-input:autofill + label,
.settings-field--outlined .settings-input.is-filled + label {
    top: 0;
    left: 2.25rem;
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--btn-primary-bg);
}

.settings-input-wrap {
    position: relative;
}

.settings-input-wrap--textarea .settings-input-icon {
    top: 1.15rem;
    transform: none;
}

.settings-input-icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    display: inline-flex;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.settings-input-icon--currency {
    font-size: calc(var(--font-body-size, 14px) + 2px);
    font-weight: 700;
    line-height: 1;
}

.settings-input {
    width: 100%;
    min-height: 52px;
    padding: 1.15rem 0.875rem 0.55rem 2.65rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: var(--font-body-size, 14px);
    font-weight: 400;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.settings-input--textarea {
    min-height: 7.5rem;
    padding-top: 1.35rem;
    resize: vertical;
}

.settings-input::placeholder {
    color: transparent;
}

.settings-input:hover {
    border-color: var(--border-dashed);
}

.settings-input:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 4px var(--focus-ring);
    background: var(--bg-card);
}

.settings-field--outlined .settings-input:focus + label {
    background: var(--settings-field-label-bg, var(--bg-card));
}

.settings-field--outlined .settings-input:-webkit-autofill + label,
.settings-field--outlined .settings-input:autofill + label,
.settings-field--outlined .settings-input.is-filled + label {
    background: var(--settings-field-label-bg, var(--bg-input));
}

.settings-field--outlined .settings-input:-webkit-autofill:focus + label,
.settings-field--outlined .settings-input.is-filled:focus + label {
    background: var(--settings-field-label-bg, var(--bg-card));
}

.settings-input:-webkit-autofill {
    animation-name: auth-autofill-start;
    animation-duration: 0.001s;
}

.settings-input:-webkit-autofill,
.settings-input:-webkit-autofill:hover,
.settings-input:-webkit-autofill:focus,
.settings-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
    transition: background-color 99999s ease-out 0s;
}

.settings-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-card) inset !important;
}

.settings-password-field .settings-input-wrap .settings-input {
    padding-right: 2.75rem;
}

.settings-password-field .password-toggle {
    right: 0.5rem;
}

.settings-field--outlined .settings-input--select + label {
    top: 0;
    left: 2.25rem;
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--btn-primary-bg);
    background: var(--settings-field-label-bg, var(--bg-input));
}

.settings-field--outlined .settings-input--select:focus + label {
    background: var(--settings-field-label-bg, var(--bg-card));
}

.settings-input--select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.75rem;
    cursor: pointer;
}

.settings-input-wrap--select::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.settings-input[type='date']::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.65;
}

.form-group .settings-field--outlined + .form-hint {
    margin-top: 0.5rem;
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    max-width: 360px;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: #15803d;
}

.toast-error {
    background: #dc2626;
}

.toast-info {
    background: #1a1a2e;
}

/* Responsive layout */
@media (max-width: 768px) {
    body:not(.auth-page) {
        display: block;
    }

    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-shrink: 0;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-card);
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: var(--bg-input);
        color: var(--text-primary);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .mobile-menu-btn:hover {
        background: var(--bg-hover);
    }

    .mobile-menu-btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px var(--focus-ring);
    }

    .mobile-topbar-title {
        margin: 0;
        min-width: 0;
        flex: 1;
        font-size: var(--font-title-size, 14px);
        font-weight: 700;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        z-index: 1100;
        width: min(85vw, 280px);
        max-width: 280px;
        height: 100dvh;
        align-self: auto;
        transform: translate3d(-100%, 0, 0);
        transition: transform 0.22s ease, box-shadow 0.22s ease;
        box-shadow: none;
        will-change: transform;
    }

    #navToggle:checked ~ .sidebar {
        transform: translate3d(0, 0, 0);
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25);
    }

    .sidebar-backdrop {
        display: block;
    }

    .layout {
        width: 100%;
        min-height: 100dvh;
        position: relative;
        z-index: 1;
    }

    body:has(#navToggle:checked) {
        overflow: hidden;
    }

    .main-content {
        padding: 1rem;
    }

    .page-header,
    .section-toolbar {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .page-actions {
        justify-content: stretch;
    }

    .page-actions .btn,
    .section-toolbar .btn {
        width: 100%;
    }

    .settings-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .settings-tab {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .settings-card,
    .settings-card-wide,
    .setup-card,
    .form-card {
        padding: 1rem;
    }

    .branding-logo-preview {
        flex-wrap: wrap;
    }

    .dashboard-footer {
        font-size: 12px;
    }

    .dashboard-footer-sep {
        display: none;
    }

    .data-table .col-hide-sm {
        display: none;
    }

    .data-table td {
        overflow-wrap: anywhere;
    }

    .license-qr-box {
        min-height: 220px;
        padding: 1rem;
    }

    .license-qr-image {
        width: min(100%, 240px);
    }

    .modal {
        padding: 0.75rem;
    }

    .modal-dialog {
        max-height: calc(100dvh - 1.5rem);
    }

    .modal-footer .btn,
    .modal-footer .action-btn {
        flex: 0 0 auto;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
    }

    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-shell {
        padding: 1rem;
    }

    .auth-panel {
        padding: 1.5rem 1.25rem;
    }

    .auth-page {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .main-content {
        padding: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem 0.75rem;
    }

    .modal {
        padding: 0.5rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-inline: 1rem;
    }

    .modal-footer--icons {
        flex-direction: row;
        justify-content: flex-end;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Public hotspot portal (portalhs.php) */
.portal-public-page {
    min-height: 100vh;
    color: #f8fafc;
    background: var(--auth-gradient);
    overflow-x: hidden;
}

.portal-public-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--auth-gradient);
}

.portal-public-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% -15%, rgba(16, 185, 129, 0.22), transparent 58%),
        radial-gradient(circle at 12% 88%, rgba(4, 120, 87, 0.2) 0%, transparent 42%),
        radial-gradient(circle at 88% 78%, rgba(52, 211, 153, 0.14) 0%, transparent 40%);
}

.portal-public-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.6px, transparent 0.6px);
    background-size: clamp(18px, 3.5vw, 28px) clamp(18px, 3.5vw, 28px);
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 20%, transparent 100%);
}

body.theme-dark.portal-public-page .portal-public-bg::before {
    background:
        radial-gradient(ellipse 90% 70% at 50% -15%, rgba(16, 185, 129, 0.16), transparent 58%),
        radial-gradient(circle at 12% 88%, rgba(4, 120, 87, 0.14) 0%, transparent 42%),
        radial-gradient(circle at 88% 78%, rgba(52, 211, 153, 0.1) 0%, transparent 40%);
}

.portal-public-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(clamp(40px, 8vw, 90px));
    opacity: 0.88;
    animation: portal-public-float 22s ease-in-out infinite;
    will-change: transform;
}

.portal-public-orb--1 {
    width: clamp(180px, 42vw, 420px);
    height: clamp(180px, 42vw, 420px);
    top: clamp(-6rem, -8vw, -3rem);
    left: clamp(-4rem, -6vw, -2rem);
    background: var(--auth-orb-1);
}

.portal-public-orb--2 {
    width: clamp(150px, 36vw, 360px);
    height: clamp(150px, 36vw, 360px);
    right: clamp(-3rem, -5vw, -1.5rem);
    top: clamp(8%, 18vh, 22%);
    background: var(--auth-orb-2);
    animation-delay: -7s;
}

.portal-public-orb--3 {
    width: clamp(200px, 48vw, 440px);
    height: clamp(200px, 48vw, 440px);
    bottom: clamp(-5rem, -10vw, -2rem);
    left: clamp(18%, 28vw, 32%);
    background: var(--auth-orb-3);
    animation-delay: -14s;
}

@keyframes portal-public-float {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    33% {
        transform: translate3d(2.5vw, -1.8vh, 0) scale(1.04);
    }

    66% {
        transform: translate3d(-1.8vw, 1.2vh, 0) scale(0.97);
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-public-orb,
    .portal-public-net,
    .portal-public-deco,
    .portal-public-wifi-badge {
        animation: none;
    }
}

@media (max-width: 480px) {
    .portal-public-orb {
        filter: blur(clamp(32px, 10vw, 56px));
        opacity: 0.72;
    }

    .portal-public-bg::after {
        opacity: 0.22;
    }
}

.portal-public-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1320px);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 2.5rem);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    gap: clamp(1.5rem, 4vw, 2.5rem);
}

.portal-public-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 1.75rem;
    padding: clamp(1rem, 3vw, 1.75rem);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

body.theme-dark.portal-public-page .portal-public-hero {
    background: rgba(15, 28, 24, 0.72);
    border-color: rgba(52, 211, 153, 0.14);
}

.portal-public-brand {
    display: flex;
    align-items: center;
    gap: clamp(0.85rem, 2vw, 1.25rem);
    min-width: 0;
    flex: 1 1 280px;
}

.portal-public-logo {
    width: clamp(52px, 10vw, 72px);
    height: clamp(52px, 10vw, 72px);
    flex-shrink: 0;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.portal-public-logo.brand-mark--letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    color: #ecfdf5;
    background: linear-gradient(145deg, #059669, #047857);
}

.portal-public-brand-text {
    min-width: 0;
}

.portal-public-company {
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(167, 243, 208, 0.92);
    margin-bottom: 0.2rem;
}

.portal-public-title {
    font-size: clamp(1.35rem, 4vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.portal-public-tagline {
    font-size: clamp(0.85rem, 2.2vw, 0.98rem);
    line-height: 1.5;
    color: rgba(226, 232, 240, 0.82);
    max-width: 42ch;
}

.portal-public-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #ecfdf5;
    background: rgba(16, 185, 129, 0.22);
    border: 1px solid rgba(110, 231, 183, 0.35);
    white-space: nowrap;
}

.portal-public-hero-badge-icon {
    display: inline-flex;
    color: #6ee7b7;
}

.portal-public-main {
    flex: 1;
}

.portal-public-section-head {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    text-align: center;
}

.portal-public-section-title {
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.portal-public-section-sub {
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    color: rgba(226, 232, 240, 0.78);
}

.portal-public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
    align-items: stretch;
}

.portal-profile-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1.1rem, 3vw, 1.5rem);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body.theme-dark.portal-public-page .portal-profile-card {
    background: rgba(15, 28, 24, 0.92);
    border-color: rgba(52, 211, 153, 0.16);
    color: #f1f5f9;
}

.portal-profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
}

.portal-profile-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.portal-profile-card-name {
    font-size: clamp(1.05rem, 2.5vw, 1.2rem);
    font-weight: 800;
    color: var(--text-primary, #1a1a2e);
    line-height: 1.25;
}

body.theme-dark.portal-public-page .portal-profile-card-name {
    color: #f8fafc;
}

.portal-profile-card-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
}

.portal-profile-card-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    min-width: 5.5rem;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.portal-profile-card-badge--time {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.portal-profile-card-badge-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #047857;
}

.portal-profile-card-badge--time .portal-profile-card-badge-label {
    color: #1d4ed8;
}

.portal-profile-card-badge-value {
    font-size: clamp(0.78rem, 2.2vw, 0.92rem);
    font-weight: 800;
    line-height: 1.2;
    color: #065f46;
}

.portal-profile-card-badge--time .portal-profile-card-badge-value {
    color: #1e40af;
}

body.theme-dark.portal-public-page .portal-profile-card-badge {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(52, 211, 153, 0.35);
}

body.theme-dark.portal-public-page .portal-profile-card-badge--time {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.35);
}

body.theme-dark.portal-public-page .portal-profile-card-badge-label {
    color: #6ee7b7;
}

body.theme-dark.portal-public-page .portal-profile-card-badge--time .portal-profile-card-badge-label {
    color: #93c5fd;
}

body.theme-dark.portal-public-page .portal-profile-card-badge-value {
    color: #d1fae5;
}

body.theme-dark.portal-public-page .portal-profile-card-badge--time .portal-profile-card-badge-value {
    color: #dbeafe;
}

.portal-profile-card-validity {
    flex-shrink: 0;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #047857;
    background: #d1fae5;
}

body.theme-dark.portal-public-page .portal-profile-card-validity {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.18);
}

.portal-profile-card-price-wrap {
    padding: 0.85rem 0 0.25rem;
    border-top: 1px dashed var(--border-dashed, #cbd5e1);
    border-bottom: 1px dashed var(--border-dashed, #cbd5e1);
}

.portal-profile-card-price {
    display: block;
    font-size: clamp(1.85rem, 5vw, 2.35rem);
    font-weight: 800;
    line-height: 1;
    color: #047857;
}

body.theme-dark.portal-public-page .portal-profile-card-price {
    color: #34d399;
}

.portal-profile-card-meta {
    list-style: none;
    display: grid;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--text-secondary, #334155);
}

body.theme-dark.portal-public-page .portal-profile-card-meta {
    color: #cbd5e1;
}

.portal-profile-card-meta li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.portal-profile-card-meta-icon {
    display: inline-flex;
    margin-top: 0.1rem;
    color: #059669;
    flex-shrink: 0;
}

.portal-profile-card-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.28);
}

.portal-profile-card-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(5, 150, 105, 0.34);
}

.portal-profile-card-btn:active {
    transform: translateY(0);
}

.portal-public-empty {
    text-align: center;
    padding: clamp(2rem, 6vw, 3.5rem) clamp(1rem, 4vw, 2rem);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px dashed rgba(255, 255, 255, 0.22);
    color: rgba(241, 245, 249, 0.9);
}

.portal-public-empty-icon {
    display: inline-flex;
    margin-bottom: 1rem;
    color: #6ee7b7;
}

.portal-public-empty h3 {
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 800;
    margin-bottom: 0.45rem;
    color: #ffffff;
}

.portal-public-empty p {
    font-size: 0.95rem;
    color: rgba(226, 232, 240, 0.78);
}

.portal-public-footer {
    text-align: center;
    padding-top: 0.5rem;
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.62);
}

@media (max-width: 640px) {
    .portal-public-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-public-hero-badge {
        align-self: flex-start;
    }

    .portal-public-brand {
        flex-direction: column;
        align-items: flex-start;
    }
}

.portal-public-net {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(110, 231, 183, 0.22);
    opacity: 0.55;
    animation: portal-net-pulse 5s ease-in-out infinite;
}

.portal-public-net--1 {
    width: clamp(7rem, 18vw, 11rem);
    height: clamp(7rem, 18vw, 11rem);
    top: 8%;
    right: 6%;
    border-color: rgba(52, 211, 153, 0.28);
}

.portal-public-net--2 {
    width: clamp(5rem, 14vw, 8rem);
    height: clamp(5rem, 14vw, 8rem);
    bottom: 14%;
    left: 5%;
    animation-delay: -1.8s;
}

.portal-public-net--3 {
    width: clamp(3.5rem, 10vw, 5.5rem);
    height: clamp(3.5rem, 10vw, 5.5rem);
    top: 42%;
    left: 12%;
    border-color: rgba(96, 165, 250, 0.24);
    animation-delay: -3.2s;
}

.portal-public-deco--wifi {
    position: absolute;
    width: clamp(4.5rem, 12vw, 7rem);
    height: clamp(4.5rem, 12vw, 7rem);
    color: rgba(167, 243, 208, 0.14);
    animation: portal-public-float 24s ease-in-out infinite;
}

.portal-public-deco--wifi-1 {
    top: 10%;
    left: 4%;
    animation-delay: -5s;
}

.portal-public-deco--wifi-2 {
    bottom: 8%;
    right: 5%;
    animation-delay: -11s;
    color: rgba(96, 165, 250, 0.12);
}

@keyframes portal-net-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.45;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.72;
    }
}

.portal-public-page--compact {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--auth-gradient);
    color: var(--text-primary);
    overflow-x: hidden;
}

.portal-public-shell--compact {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(100%, 56rem);
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.85rem, 2.5vw, 1.25rem);
    padding: clamp(0.85rem, 3vw, 1.5rem);
    box-sizing: border-box;
}

.portal-public-compact-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 28rem;
}

.portal-public-brand-head {
    margin-bottom: 0.15rem;
}

.portal-public-brand-logo {
    width: clamp(3.25rem, 10vw, 4rem);
    height: clamp(3.25rem, 10vw, 4rem);
    margin-bottom: 0.35rem;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.portal-public-brand-logo.brand-mark--letter {
    background: rgba(16, 185, 129, 0.92);
    color: #ffffff;
    border: 1px solid rgba(110, 231, 183, 0.45);
}

.portal-public-brand-logo.brand-mark--image {
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.85);
}

.portal-public-brand-company {
    margin: 0;
    color: rgba(167, 243, 208, 0.92);
    letter-spacing: 0.14em;
}

.portal-public-brand-version {
    margin: 0;
    color: rgba(226, 232, 240, 0.62);
    font-size: clamp(0.72rem, 2.1vw, 0.82rem);
}

.portal-public-brand-tagline {
    max-width: 22rem;
}

.portal-public-wifi-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(3rem, 9vw, 3.75rem);
    height: clamp(3rem, 9vw, 3.75rem);
    border-radius: 999px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(110, 231, 183, 0.35);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.35);
    animation: portal-wifi-glow 2.8s ease-in-out infinite;
}

.portal-public-wifi-badge svg {
    width: 58%;
    height: 58%;
}

.portal-public-compact-title {
    margin: 0;
    font-size: clamp(1.25rem, 4.5vw, 1.65rem);
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.portal-public-compact-tagline {
    margin: 0;
    font-size: clamp(0.8rem, 2.4vw, 0.95rem);
    line-height: 1.4;
    color: rgba(226, 232, 240, 0.78);
}

@keyframes portal-wifi-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.25);
    }

    50% {
        box-shadow: 0 0 0 0.45rem rgba(52, 211, 153, 0.08);
    }
}

.portal-public-cards-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.portal-public-footer--compact {
    width: 100%;
    margin: 0;
    padding: 0.15rem 0 0;
    text-align: center;
    font-size: clamp(0.68rem, 2vw, 0.78rem);
    color: rgba(226, 232, 240, 0.72);
}

.portal-public-footer--compact p {
    margin: 0;
    line-height: 1.4;
}

.portal-public-footer-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
}

.portal-public-footer-sep {
    opacity: 0.55;
}

.portal-public-footer--compact a {
    color: #a7f3d0;
    font-weight: 700;
    text-decoration: none;
}

.portal-public-footer--compact a:hover {
    color: #d1fae5;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.theme-light.portal-public-page--compact .portal-public-footer--compact {
    color: rgba(255, 255, 255, 0.78);
}

body.theme-light.portal-public-page--compact .portal-public-footer--compact a {
    color: #ecfdf5;
}

.portal-public-grid--compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(0.75rem, 2.5vw, 1rem);
    width: min(100%, 20rem);
    margin: 0 auto;
}

.portal-profile-card--compact {
    width: 100%;
    max-width: none;
    min-width: 0;
    gap: clamp(0.75rem, 2.2vw, 0.9rem);
    padding: clamp(1rem, 3.2vw, 1.3rem);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.75) inset;
    text-align: center;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.portal-profile-card--compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #059669, #34d399, #10b981);
}

.portal-plan-card__top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.portal-plan-card__wifi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(2.35rem, 7vw, 2.75rem);
    height: clamp(2.35rem, 7vw, 2.75rem);
    border-radius: 14px;
    color: #059669;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.16), rgba(52, 211, 153, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.portal-plan-card__wifi svg {
    width: 1.2rem;
    height: 1.2rem;
}

.portal-plan-card__price {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #047857;
}

.portal-plan-card__specs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
    width: 100%;
}

.portal-plan-card__spec {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: clamp(0.5rem, 2vw, 0.62rem) clamp(0.65rem, 2.5vw, 0.8rem);
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.14);
}

.portal-plan-card__spec--time {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.14);
}

.portal-plan-card__spec-label {
    font-size: clamp(0.68rem, 2vw, 0.76rem);
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portal-plan-card__spec-value {
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    font-weight: 800;
    color: #065f46;
    text-align: right;
}

.portal-plan-card__spec--time .portal-plan-card__spec-value {
    color: #1e40af;
}

.portal-profile-card--compact .portal-profile-card-badges,
.portal-profile-card--compact .portal-profile-card-price-wrap,
.portal-profile-card-compact-body {
    display: none;
}

.portal-plan-card__btn {
    width: 100%;
    margin-top: 0.1rem;
    padding: clamp(0.7rem, 2.8vw, 0.85rem) 1rem;
    font-size: clamp(0.88rem, 2.6vw, 0.98rem);
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.3);
    letter-spacing: 0.02em;
}

.portal-profile-card--compact:hover {
    transform: translateY(-3px);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.16),
        0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.portal-plan-card__btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 26px rgba(5, 150, 105, 0.38);
}

@media (min-width: 480px) {
    .portal-public-grid--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(100%, 34rem);
    }
}

@media (min-width: 768px) {
    .portal-public-grid--compact {
        width: min(100%, 48rem);
        grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .portal-public-grid--compact {
        width: min(100%, 54rem);
    }

    .portal-profile-card--compact {
        padding: 1.35rem;
    }
}

body.theme-dark.portal-public-page--compact .portal-profile-card--compact {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

body.theme-dark.portal-public-page--compact .portal-plan-card__price {
    color: #34d399;
}

body.theme-dark.portal-public-page--compact .portal-plan-card__wifi {
    color: #6ee7b7;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.22), rgba(52, 211, 153, 0.08));
    border-color: rgba(52, 211, 153, 0.3);
}

body.theme-dark.portal-public-page--compact .portal-plan-card__spec {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(52, 211, 153, 0.22);
}

body.theme-dark.portal-public-page--compact .portal-plan-card__spec--time {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.22);
}

body.theme-dark.portal-public-page--compact .portal-plan-card__spec-label {
    color: #94a3b8;
}

body.theme-dark.portal-public-page--compact .portal-plan-card__spec-value {
    color: #a7f3d0;
}

body.theme-dark.portal-public-page--compact .portal-plan-card__spec--time .portal-plan-card__spec-value {
    color: #bfdbfe;
}

.modal-dialog--portal-buy {
    width: min(100%, 420px);
}

.portal-buy-summary {
    margin: 0 0 0.75rem;
    text-align: center;
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    color: var(--text-secondary);
}

.portal-buy-qr-box {
    min-height: 280px;
}

.portal-voucher-code {
    margin-top: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    text-align: center;
}

.portal-voucher-code-label {
    margin: 0 0 0.35rem;
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-voucher-code-value {
    margin: 0;
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    font-weight: 800;
    color: var(--btn-primary-bg);
    word-break: break-all;
}

.portal-buy-close,
.portal-buy-close-btn {
    cursor: pointer;
}

.portal-buy-mobile-stage {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.portal-buy-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-buy-label {
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    color: var(--text-secondary);
}

.portal-buy-input {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-input, var(--bg-card));
    color: var(--text-primary);
    font-size: var(--font-body-size, 14px);
}

.portal-buy-input:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--btn-primary-bg) 20%, transparent);
}

.portal-buy-hint {
    margin: 0;
    font-size: var(--font-sub-size, 13px);
    color: var(--text-muted);
}

.portal-buy-error {
    margin: 0;
    font-size: var(--font-sub-size, 13px);
    color: #dc2626;
}

.portal-buy-continue-btn {
    width: 100%;
    margin-top: 0.25rem;
}

.portal-buy-payment-stage[hidden] {
    display: none !important;
}

.portal-buy-mobile-stage[hidden] {
    display: none !important;
}

.portal-log-code {
    font-size: var(--font-sub-size, 13px);
    font-weight: 700;
    word-break: break-all;
}

.portal-log-payment-id {
    display: inline-block;
    max-width: 11rem;
    font-size: 0.75rem;
    font-weight: 600;
    word-break: break-all;
    color: var(--text-secondary, #475569);
}

body.theme-dark .portal-log-payment-id {
    color: #cbd5e1;
}

.portal-validity-error {
    margin: 0.35rem 0 0;
    font-size: var(--font-sub-size, 13px);
    color: #dc2626;
}

.portal-deactivate-error {
    margin: 0;
    font-size: var(--font-sub-size, 13px);
    color: #dc2626;
}

.portal-profile-row--inactive {
    opacity: 0.65;
}
