:root {
    --accent: #c41e3a;
    --accent-dark: #9a1830;
    --accent-soft: #fff0f2;
    --sidebar-bg: #141414;
    --sidebar-text: #e8e8e8;
    --sidebar-muted: #d4d4d4;
    --content-bg: #ffffff;
    --page-bg: #f4f5f7;
    --card-border: #e8e8ec;
    --text-primary: #141414;
    --text-secondary: #5c5c66;
    --alert-bg: #fff4f6;
    --alert-border: #f5c2cb;
    --shadow: 0 2px 14px rgba(20, 20, 20, 0.06);
    --shadow-lg: 0 12px 40px rgba(20, 20, 20, 0.12);
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--page-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    background: #f0f0f4;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.muted {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
}

/* ── Login page ── */

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

.login-brand {
    flex: 1.1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    border-right: 1px solid var(--card-border);
}

.login-brand-logo {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.15rem;
}

.login-brand-logo span {
    color: var(--accent);
}

.login-brand-sub {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.login-brand-tagline {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2rem;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 420px;
}

.login-features li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.95rem;
}

.login-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.login-panel {
    flex: 1;
    background: linear-gradient(155deg, #121212 0%, #2a2a2a 55%, #1e1e1e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
}

.login-card-light {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: var(--radius);
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-lg);
}

.login-card-light h1 {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-card-light .subtitle {
    color: var(--text-secondary);
    font-size: 0.925rem;
    margin: 0 0 1.75rem;
}

.form-group-light label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.45;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.input-icon-user {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%235c5c66' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5zm0 2c-4.42 0-8 2.24-8 5v1h16v-1c0-2.76-3.58-5-8-5z'/%3E%3C/svg%3E");
}

.input-icon-lock {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%235c5c66' viewBox='0 0 24 24'%3E%3Cpath d='M17 8V7a5 5 0 0 0-10 0v1H5v14h14V8zm-8 0V7a3 3 0 0 1 6 0v1z'/%3E%3C/svg%3E");
}

.form-group-light input {
    width: 100%;
    padding: 0.8rem 0.9rem 0.8rem 2.6rem;
    border: 1px solid #d8d8de;
    border-radius: 8px;
    background: #fafafa;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group-light input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
    background: #fff;
}

.form-group-light {
    margin-bottom: 1.2rem;
}

.btn-signin {
    width: 100%;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    transition: opacity 0.15s, transform 0.1s;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-signin:hover {
    opacity: 0.93;
    text-decoration: none;
}

.btn-signin:active {
    transform: scale(0.99);
}

.btn-signin-arrow {
    font-size: 1.1rem;
}

.login-error-light {
    background: var(--alert-bg);
    border: 1px solid var(--alert-border);
    color: #8b1c2e;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.login-footer-note {
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

/* ── Dashboard shell ── */

.sidebar-backdrop {
    display: none;
}

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

.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: 252px;
    min-height: 100vh;
    height: auto;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 3px solid var(--accent);
    transition: width 0.22s ease;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1.25rem 0 1rem;
    overflow: visible;
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -14px;
    transform: translateY(-50%);
    width: 28px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 0 10px 10px 0;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(196, 30, 58, 0.35);
    transition: background 0.12s;
}

.sidebar-toggle:hover {
    background: var(--accent-dark);
}

.sidebar-toggle-chevron {
    display: block;
    width: 8px;
    height: 8px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translateX(2px);
    transition: transform 0.22s ease;
}

.app-shell.sidebar-collapsed .sidebar {
    width: 76px;
}

.app-shell.sidebar-collapsed .sidebar-brand-sub,
.app-shell.sidebar-collapsed .sidebar-version,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .sidebar-user-label,
.app-shell.sidebar-collapsed .sidebar-user-name,
.app-shell.sidebar-collapsed .sidebar-logout {
    display: none;
}

.app-shell.sidebar-collapsed .sidebar-brand {
    padding: 0 0.65rem 1rem;
    text-align: center;
}

.app-shell.sidebar-collapsed .sidebar-brand-title {
    font-size: 0.95rem;
}

.app-shell.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.72rem 0.5rem;
}

.app-shell.sidebar-collapsed .sidebar-toggle-chevron {
    transform: rotate(-135deg) translateX(2px);
}

.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-nav-toggle-icon {
    width: 18px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23141414' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.topbar-start {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-width: 0;
}

.sidebar-brand {
    padding: 0 1.35rem 1.25rem;
    border-bottom: 1px solid #262626;
    margin-bottom: 0.75rem;
}

.sidebar-brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.sidebar-brand-title span {
    color: var(--accent);
}

.sidebar-brand-sub {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--sidebar-muted);
    margin-top: 0.25rem;
}

.sidebar-version {
    font-size: 0.72rem;
    color: #666;
    margin-top: 0.6rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav li {
    margin: 0.1rem 0.65rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.85rem;
    color: #f5f5f5;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link:hover {
    background: #222;
    color: #ffffff;
    text-decoration: none;
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(196, 30, 58, 0.22) 0%, rgba(196, 30, 58, 0.08) 100%);
    border-left: 3px solid var(--accent);
    padding-left: calc(0.85rem - 3px);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.75;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.nav-link.active .nav-icon {
    opacity: 1;
}

.nav-icon-dashboard {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M3 13h8V3H3zm0 8h8v-6H3zm10 0h8V11h-8zm0-18v6h8V3z'/%3E%3C/svg%3E");
}

.nav-icon-users {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5C15 14.17 10.33 13 8 13zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
}

.nav-icon-devices {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M17 1H7c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 18H7V5h10v14z'/%3E%3C/svg%3E");
}

.nav-icon-plans {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M4 8h4V4H4v4zm6 12h4v-4h-4v4zM4 20h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z'/%3E%3C/svg%3E");
}

.nav-icon-plan_requests {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 14-5-5 1.41-1.41L12 14.17l4.59-4.58L18 11l-6 6z'/%3E%3C/svg%3E");
}

.nav-icon-entitlements {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z'/%3E%3C/svg%3E");
}

.nav-icon-usage {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E");
}

.nav-icon-sync {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z'/%3E%3C/svg%3E");
}

.nav-icon-ota {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M17.6 9.48 19.2 8 12 1 4.8 8l1.6 1.48L11 5.17V16h2V5.17l4.6 4.31zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
}

.nav-icon-logs,
.nav-icon-django {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
}

.nav-icon-compliance {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z'/%3E%3C/svg%3E");
}

.sidebar-user {
    padding: 1rem 1.35rem 0;
    border-top: 1px solid #262626;
    margin-top: auto;
}

.sidebar-user-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b8b8b8;
}

.sidebar-user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    margin: 0.2rem 0 0.5rem;
    word-break: break-word;
}

.sidebar-logout,
.sidebar-account-link {
    font-size: 0.82rem;
    color: #ffffff;
    display: block;
    margin-top: 0.35rem;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--page-bg);
}

.topbar {
    background: var(--content-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 1.15rem 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.topbar h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.time-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f0f0f4;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.time-pill-icon {
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%235c5c66' viewBox='0 0 24 24'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E");
    background-size: contain;
}

.notif-bell {
    position: relative;
}

.notif-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.notif-bell-btn:hover,
.notif-bell.open .notif-bell-btn {
    background: #f7f7fb;
    border-color: #d8d8e2;
}

.notif-bell-icon {
    font-size: 1rem;
    line-height: 1;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.55rem);
    width: min(360px, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(17, 17, 26, 0.14);
    z-index: 40;
    overflow: hidden;
}

.notif-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--card-border);
    background: #fafafc;
}

.notif-mark-all {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.notif-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f0f0f4;
    text-decoration: none;
    color: inherit;
}

.notif-item:hover {
    background: #fafafc;
}

.notif-item-title {
    font-size: 0.86rem;
    font-weight: 650;
    margin-bottom: 0.2rem;
}

.notif-item-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.notif-item-time {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: #8a8a96;
}

.notif-item.notif-warning .notif-item-title {
    color: #b45309;
}

.notif-item.notif-critical .notif-item-title {
    color: var(--accent);
}

.notif-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.content {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
}

.page-footer {
    padding: 0.85rem 2rem 1.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--card-border);
    background: var(--content-bg);
}

/* ── Sections ── */

.section {
    margin-bottom: 1.5rem;
}

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

.section-header.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.section-desc {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 720px;
    line-height: 1.5;
}

.panel {
    background: var(--content-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* ── Alert banner ── */

.alert-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--alert-bg);
    border: 1px solid var(--alert-border);
    border-radius: var(--radius);
    padding: 0.95rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-banner-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
    background-size: contain;
}

.alert-banner-text {
    flex: 1;
    font-size: 0.925rem;
    color: #7a1f2e;
}

.btn-alert {
    flex-shrink: 0;
    padding: 0.5rem 1.1rem;
    background: var(--accent);
    color: #ffffff !important;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.btn-alert:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.btn-ghost {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.btn-ghost:hover {
    text-decoration: underline;
}

/* ── Info cards (administrator row) ── */

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: var(--content-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow);
}

.info-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-soft);
    flex-shrink: 0;
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: center;
}

.info-icon-user {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5zm0 2c-4.42 0-8 2.24-8 5v1h16v-1c0-2.76-3.58-5-8-5z'/%3E%3C/svg%3E");
}

.info-icon-email {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5L4 8V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.info-icon-clock {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E");
}

.info-icon-device {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M17 1H7c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 18H7V5h10v14z'/%3E%3C/svg%3E");
}

.info-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.info-value-email {
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
}

/* ── KPI cards ── */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.kpi-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.platform-kpi-grid .kpi-card {
    min-height: 104px;
    padding: 1rem 0.9rem 1.1rem;
}

.platform-kpi-grid .kpi-label {
    font-size: 0.68rem;
    line-height: 1.35;
}

.platform-kpi-grid .kpi-value {
    font-size: 1.85rem;
}

.kpi-contacts {
    background: linear-gradient(135deg, #5a189a 0%, #3c096c 100%);
}

.kpi-card {
    position: relative;
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    color: #ffffff;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-height: 118px;
}

.kpi-card::after {
    content: "";
    position: absolute;
    right: -12px;
    bottom: -12px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.kpi-users {
    background: linear-gradient(135deg, #c41e3a 0%, #8f1529 100%);
}

.kpi-pending {
    background: linear-gradient(135deg, #e85d04 0%, #c44d00 100%);
}

.kpi-active {
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
}

.kpi-plans {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

.kpi-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 0.65rem;
    opacity: 0.9;
    background-size: contain;
    background-repeat: no-repeat;
}

.kpi-users .kpi-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5C15 14.17 10.33 13 8 13zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
}

.kpi-pending .kpi-icon,
.kpi-active .kpi-icon,
.kpi-plans .kpi-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

.kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

/* ── Sync tiles ── */

.sync-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.85rem;
}

.sync-tile {
    background: var(--content-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.1rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.sync-tile-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}

.sync-tile-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

/* ── Tables ── */

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 0.55rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
}

.data-table td {
    padding: 0.7rem 0.65rem;
    border-bottom: 1px solid #f0f0f4;
    vertical-align: middle;
}

.data-table tbody tr:hover td {
    background: #fafafa;
}

.changelog-row td {
    padding-top: 0;
    border-bottom: 1px solid #f0f0f4;
}

.changelog-cell {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-bottom: 0.75rem !important;
    padding-left: 0.65rem !important;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active {
    background: #d8f3dc;
    color: #1b4332;
}

.badge-inactive {
    background: #f0f0f4;
    color: #666;
}

.badge-deletion {
    background: #fde8e8;
    color: #9b1c1c;
    border: 1px solid #f5c2c2;
}

.security-otp-dialog {
    max-width: 440px;
    width: calc(100% - 2rem);
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1.25rem;
    background: #fff;
}

.security-otp-dialog::backdrop {
    background: rgba(20, 20, 20, 0.45);
}

.security-otp-message {
    margin: 0 0 1rem;
    color: #333;
    line-height: 1.45;
}

.security-otp-form .form-actions {
    margin-top: 1rem;
}

.deletion-banner {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #fde8e8;
    border: 1px solid #f5c2c2;
    color: #7f1d1d;
}

.badge-expired {
    background: #fff3cd;
    color: #856404;
}

.badge-beta {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.badge-prod {
    background: #dbeafe;
    color: #1e40af;
}

.log-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.kpi-log-card,
a.kpi-card.kpi-log-card,
a.kpi-card.kpi-log-card:visited {
    text-decoration: none;
    color: #ffffff;
    display: block;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

.kpi-log-card:hover,
a.kpi-card.kpi-log-card:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: #ffffff;
}

a.kpi-card.kpi-log-card .kpi-label,
a.kpi-card.kpi-log-card .kpi-value,
a.kpi-card.kpi-log-card .kpi-substats,
a.kpi-card.kpi-log-card .kpi-substats span {
    color: #ffffff;
}

.log-cat-authentication,
a.kpi-card.kpi-log-card.log-cat-authentication { background: linear-gradient(135deg, #c41e3a 0%, #8f1529 100%); }
.log-cat-admin,
a.kpi-card.kpi-log-card.log-cat-admin { background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%); }
.log-cat-usage,
a.kpi-card.kpi-log-card.log-cat-usage { background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%); }
.log-cat-transactions,
a.kpi-card.kpi-log-card.log-cat-transactions { background: linear-gradient(135deg, #e85d04 0%, #c44d00 100%); }
.log-cat-sync,
a.kpi-card.kpi-log-card.log-cat-sync { background: linear-gradient(135deg, #0f766e 0%, #115e59 100%); }
.log-cat-device,
a.kpi-card.kpi-log-card.log-cat-device { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.log-cat-data_export,
a.kpi-card.kpi-log-card.log-cat-data_export { background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%); }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
    margin: 0;
}
.detail-grid dt {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.detail-grid dd {
    margin: 0;
    font-size: 0.95rem;
}
.detail-span-2 {
    grid-column: 1 / -1;
}
.meta-pre {
    margin: 0;
    padding: 0.85rem 1rem;
    background: #f7f7fa;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: auto;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.kpi-substats {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.68rem;
    opacity: 0.92;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2000;
}

.modal-backdrop[hidden] {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

.modal-card {
    width: min(640px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--card-border);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f4;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1rem 1.25rem 1.25rem;
}

.modal-subtitle {
    margin: 1rem 0 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.modal-bullets {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-primary);
}

.modal-bullets li {
    margin: 0.35rem 0;
}

.link-action {
    font-weight: 600;
    font-size: 0.82rem;
}

.empty-state {
    padding: 1.5rem 0.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.empty-state p {
    margin: 0.35rem 0;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.empty-cell {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem !important;
}

.col-check {
    width: 36px;
}

/* ── Toolbar & buttons ── */

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.toolbar {
    margin-bottom: 1rem;
}

.toolbar-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.info-banner {
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    background: #f8f9fc;
    border-left: 4px solid var(--accent);
}

.info-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.section {
    margin-bottom: 1.25rem;
}

.section-header {
    margin-bottom: 0.85rem;
}

.section-header h2 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.analytics-section {
    margin-bottom: 1.5rem;
}

.analytics-range-toolbar {
    margin: 0 0 1.25rem;
}

.toolbar-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

.analytics-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.analytics-kpi-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.95rem 1rem 1rem;
    box-shadow: var(--shadow);
    min-height: 88px;
    color: var(--text-primary);
}

.analytics-kpi-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.analytics-kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    margin-top: 0.35rem;
    line-height: 1.1;
    color: var(--text-primary);
}

.chart-panel-hero {
    padding: 1rem 1.15rem 0.85rem;
}

.chart-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.chart-panel-head-toolbar {
    align-items: flex-end;
    flex-wrap: wrap;
}

.analytics-range-form {
    margin-left: auto;
}

.analytics-range-form .filter-select {
    min-width: 170px;
}

.chart-panel-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.chart-canvas-wrap {
    position: relative;
    height: 170px;
}

.chart-canvas-hero {
    height: 220px;
}

.alert-card {
    position: relative;
    border-radius: var(--radius);
    padding: 0.95rem 2.75rem 0.95rem 1rem;
    border: 1px solid var(--card-border);
    background: #fff;
    box-shadow: var(--shadow);
}

.alert-dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #d8d8de;
    border-radius: 6px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.alert-dismiss:hover {
    background: #f4f5f7;
    border-color: #c8c8d0;
    color: var(--text-primary);
}

.ota-add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ota-add-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.25rem;
    background: var(--content-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.1s;
}

.ota-add-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
}

.ota-add-card h2 {
    margin: 0;
    font-size: 1.05rem;
}

.ota-add-card p {
    margin: 0;
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.ota-add-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-soft);
}

.ota-add-icon-upload {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M9 16h6v-6h4l-7-7-7 7h4v6zm-4 2h14v2H5v-2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px;
}

.ota-add-icon-link {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M3.9 12a5 5 0 0 1 5-5h3v2H8.9a3 3 0 1 0 0 6h3v2h-3a5 5 0 0 1-5-5zm7.1 0a5 5 0 0 1 5-5h3v2h-3a3 3 0 1 0 0 6h3v2h-3a5 5 0 0 1-5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px;
}

.inventory-list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.inventory-list li {
    margin: 0.25rem 0;
}

.kpi-mini {
    background: var(--content-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow);
}

.kpi-mini-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.kpi-mini-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 0.25rem;
}

.toolbar-form-wide {
    align-items: flex-end;
}

.filter-date {
    min-width: 150px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.search-input,
.filter-select,
.form-control {
    padding: 0.55rem 0.75rem;
    border: 1px solid #d8d8de;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    min-width: 180px;
}

.search-input {
    min-width: 240px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
}

.btn-caps {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.col-actions {
    width: 88px;
    text-align: right;
}

.col-actions.col-actions-icons,
th.col-actions.col-actions-wide,
td.col-actions.col-actions-wide {
    width: 148px;
    min-width: 148px;
    white-space: nowrap;
}

.icon-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.icon-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    border: 0;
    vertical-align: middle;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex: 0 0 36px;
    border: 1px solid #e0e0e6;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    padding: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    transition: border-color 0.12s, background-color 0.12s;
}

.icon-btn:hover {
    border-color: var(--accent);
    background-color: var(--accent-soft);
    text-decoration: none;
}

.icon-btn-edit {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E");
}

.icon-btn-delete {
    border-color: #e8a0a8;
    background-color: #fdf2f3;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e3a' viewBox='0 0 24 24'%3E%3Cpath d='M6 19a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
}

.icon-btn-delete:hover {
    border-color: #c41e3a;
    background-color: #f8d7da;
}

.icon-btn-block {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%235c5c66' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31A7.902 7.902 0 0 1 12 20zm6.31-3.1L7.1 5.69A7.902 7.902 0 0 1 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z'/%3E%3C/svg%3E");
}

.icon-btn-revoke {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23b45309' viewBox='0 0 24 24'%3E%3Cpath d='M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z'/%3E%3C/svg%3E");
}

.icon-btn-view {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%235c5c66' viewBox='0 0 24 24'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5C21.27 7.61 17 4.5 12 4.5zm0 12.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-8a3 3 0 1 0 .002 6.001A3 3 0 0 0 12 9z'/%3E%3C/svg%3E");
}

.analytics-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.chart-panel h2 {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.alert-card-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.alert-card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.alert-warning { border-left: 4px solid #e85d04; }
.alert-error { border-left: 4px solid #8b1c2e; }
.alert-info { border-left: 4px solid #4361ee; }
.alert-success { border-left: 4px solid #2d6a4f; }

.nav-icon-analytics {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 18.5l6-6 4 4L20.5 9.5 22 11l-8.5 8.5-4-4-6 6z'/%3E%3C/svg%3E");
}

.btn-primary {
    background: var(--accent);
    color: #fff !important;
}

.btn-primary:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.btn-secondary {
    background: #eef0f4;
    color: var(--text-primary) !important;
}

.btn-secondary:hover {
    background: #e2e5eb;
    text-decoration: none;
}

.btn-danger {
    background: #8b1c2e;
    color: #fff !important;
}

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.bulk-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ── Forms ── */

.admin-form {
    max-width: 640px;
}

.admin-form-wide {
    max-width: none;
}

.checkbox-grid-compact {
    margin: 1rem 0;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
}

.form-row-toggle {
    margin-bottom: 0.75rem;
}

.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: #f8f9fc;
    border: 1px solid #ececf2;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.toggle-track {
    position: relative;
    width: 46px;
    height: 26px;
    background: #d1d5db;
    border-radius: 999px;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.toggle-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.toggle-switch-input:checked + .toggle-track {
    background: var(--accent);
}

.toggle-switch-input:focus-visible + .toggle-track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.toggle-switch-input:checked + .toggle-track::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-row-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    background: #f8f9fc;
    border: 1px solid #ececf2;
    border-radius: 8px;
}

.form-row-check label {
    margin: 0;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.65rem;
}

.form-layout {
    max-width: 1100px;
    width: 100%;
}

/* Stack create/list panels at matching width with consistent vertical gap */
.org-page-stack {
    max-width: 1100px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.org-page-stack > .form-layout,
.org-page-stack > form.form-layout {
    max-width: none;
    width: 100%;
}

.org-page-stack > .panel,
.org-page-stack > .section.panel {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.org-page-stack .data-table {
    width: 100%;
    table-layout: auto;
}

.org-page-stack .col-actions,
.org-page-stack th.col-actions,
.org-page-stack td.col-actions {
    width: 1%;
    min-width: 140px;
    white-space: nowrap;
    text-align: right;
    padding-right: 0.75rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-section-wide {
    grid-column: 1 / -1;
}

.form-section h2 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
}

.form-section .section-desc {
    margin-bottom: 1rem;
}

.form-row-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}

.form-section .form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f4;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.field-error {
    color: #8b1c2e;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-errors {
    background: var(--alert-bg);
    border: 1px solid var(--alert-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #7a1f2e;
}

/* ── Flash messages ── */

.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.flash-success {
    background: #d8f3dc;
    color: #1b4332;
}

.flash-warning {
    background: #fff3cd;
    color: #856404;
}

.flash-error {
    background: var(--alert-bg);
    color: #7a1f2e;
}

/* ── Pagination ── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f4;
}

.page-link {
    font-weight: 600;
    font-size: 0.85rem;
}

.page-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ── Detail views ── */

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.section-gap {
    margin-top: 1.25rem;
}

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

.panel-header h2,
.panel h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f0f0f4;
}

.detail-list dt {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.detail-list dd {
    margin: 0;
    font-size: 0.9rem;
    word-break: break-word;
}

.detail-list-stacked > div {
    grid-template-columns: 180px 1fr;
}

.meta-panel {
    margin-bottom: 1rem;
}

.inline-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* ── Sync hub ── */

.sync-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.sync-hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: var(--content-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.1s;
}

.sync-hub-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
}

.sync-hub-count {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.sync-hub-label {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
}

/* ── Responsive ── */

@media (max-width: 1100px) {
    .info-grid,
    .kpi-grid:not(.platform-kpi-grid),
    .analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ota-add-grid {
        grid-template-columns: 1fr;
    }

    .sync-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .two-col,
    .detail-grid,
    .form-grid,
    .form-row-grid,
    .analytics-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .analytics-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .platform-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .analytics-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }

    .login-brand {
        padding: 2rem;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }

    .app-shell {
        flex-direction: row;
    }

    .mobile-nav-toggle {
        display: inline-flex;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(20, 20, 20, 0.45);
        z-index: 90;
    }

    .app-shell.sidebar-mobile-open .sidebar-backdrop {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        width: min(280px, 86vw);
        transform: translateX(-105%);
        transition: transform 0.24s ease;
        box-shadow: var(--shadow-lg);
    }

    .app-shell.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-nav {
        display: block;
        padding: 0;
    }

    .sidebar-user {
        display: block;
    }

    body.nav-open {
        overflow: hidden;
    }

    .topbar {
        flex-direction: column;
        padding: 1rem;
    }

    .topbar-meta {
        width: 100%;
        flex-wrap: wrap;
    }

    .time-pill {
        white-space: normal;
    }

    .content {
        padding: 1rem;
    }

    .info-grid,
    .kpi-grid:not(.platform-kpi-grid),
    .platform-kpi-grid,
    .sync-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .info-grid,
    .kpi-grid:not(.platform-kpi-grid),
    .platform-kpi-grid,
    .analytics-kpi-grid,
    .sync-grid {
        grid-template-columns: 1fr;
    }
}

/* ── File upload with progress ── */

.file-upload-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-upload-name {
    font-size: 0.86rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.upload-progress {
    margin: 1rem 0 0.25rem;
}

.upload-progress-bar {
    height: 8px;
    background: #ececf1;
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent) 0%, #e85d04 100%);
    border-radius: 999px;
    transition: width 0.15s ease;
}

.upload-progress-text {
    margin-top: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Email preferences modal */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(20, 20, 20, 0.45);
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-lead {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
    padding: 1rem;
    background: #f8f8fa;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.modal-toggle-grid {
    margin-bottom: 0.25rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.toggle-switch.toggle-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* Enterprise nav icons */
.nav-icon-enterprise,
.nav-icon-enterprise_overview {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z'/%3E%3C/svg%3E");
}

.nav-icon-enterprise_clients {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M4 10v7h3v-7H4zm6 0v7h3v-7h-3zM2 19h20v2H2v-2zm14-9v7h3v-7h-3zm-4.5-9L2 6v2h20V6l-9.5-5z'/%3E%3C/svg%3E");
}

.nav-icon-enterprise_users,
.nav-icon-ent_users {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5C15 14.17 10.33 13 8 13zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
}

.nav-icon-enterprise_plans,
.nav-icon-ent_plans {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M4 8h4V4H4v4zm6 12h4v-4h-4v4zM4 20h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z'/%3E%3C/svg%3E");
}

.nav-icon-enterprise_pool,
.nav-icon-ent_pool {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M19.35 10.04A7.49 7.49 0 0 0 12 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z'/%3E%3C/svg%3E");
}

.nav-icon-enterprise_analytics,
.nav-icon-ent_analytics {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z'/%3E%3C/svg%3E");
}

.nav-icon-ent_sync {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z'/%3E%3C/svg%3E");
}

.nav-icon-ent_home {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

.nav-icon-ent_entitlements {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z'/%3E%3C/svg%3E");
}

.nav-icon-ent_usage {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E");
}

.nav-icon-_back_main {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e8e8e8' viewBox='0 0 24 24'%3E%3Cpath d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'/%3E%3C/svg%3E");
}

/* Login mode switch */
.login-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 0 0 1.35rem;
    padding: 0.35rem;
    background: #f3f3f6;
    border-radius: 10px;
}

.login-mode-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.login-mode-btn:hover {
    color: var(--text-primary);
    background: #ffffff;
    text-decoration: none;
}

.login-mode-btn.is-active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.28);
}

.login-mode-btn.is-active:hover {
    color: #ffffff;
    background: #a81830;
}

/* Enterprise KPI variants */
.kpi-enterprise { background: linear-gradient(135deg, #c41e3a 0%, #8f1529 100%); }
.kpi-enterprise-alt { background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%); }
.kpi-enterprise-green { background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%); }
.kpi-enterprise-orange { background: linear-gradient(135deg, #e85d04 0%, #c44d00 100%); }
.kpi-enterprise-teal { background: linear-gradient(135deg, #0f766e 0%, #115e59 100%); }
.kpi-enterprise-purple { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }

.enterprise-manage-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.enterprise-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    align-items: start;
}

.enterprise-client-profile {
    padding: 1.5rem 1.5rem 1.75rem;
}

.enterprise-client-profile .form-actions,
.enterprise-profile-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f4;
}

.label-field-rows {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.label-field-row {
    display: grid;
    grid-template-columns: minmax(7.5rem, 34%) 1fr;
    gap: 0.85rem;
    align-items: center;
}

.label-field-row label {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
}

.label-field-row-tall {
    align-items: start;
}

.label-field-row-tall label {
    padding-top: 0.55rem;
}

.label-field-row textarea {
    min-height: 7rem;
    resize: vertical;
}

.field-static {
    padding: 0.55rem 0.75rem;
    background: #f8f9fb;
    border: 1px solid #e8eaef;
    border-radius: 8px;
    color: #1f2937;
    font-size: 0.92rem;
}

.enterprise-controls-panel {
    background: #fafbfc;
    border: 1px solid #edf0f4;
    border-radius: 12px;
    padding: 1.15rem 1.15rem 1.35rem;
}

.enterprise-controls-title {
    margin: 0 0 0.85rem;
    font-size: 0.92rem;
    font-weight: 700;
}

.enterprise-control-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

.enterprise-control-stack .btn-secondary,
.enterprise-control-stack .btn-danger,
.enterprise-control-stack button {
    width: 100%;
    justify-content: center;
}

@media (max-width: 960px) {
    .enterprise-split-grid {
        grid-template-columns: 1fr;
    }
}

.col-actions-icons {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.org-members-section {
    margin-top: 0;
}

.org-members-table th.col-actions,
.org-members-table td.col-actions {
    width: 1%;
    min-width: 140px;
}

.migrate-modal {
    max-width: 480px;
    width: calc(100% - 2rem);
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1.35rem 1.5rem 1.5rem;
}
.migrate-modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.migrate-modal h3 {
    margin: 0 0 0.5rem;
}
.migrate-modal p {
    margin: 0 0 0.85rem;
    line-height: 1.45;
}
