* { box-sizing: border-box; }
:root { color: #273149; background: #f5f6fa; font: 14px/1.5 "Open Sans", "Segoe UI", system-ui, sans-serif; --muted: #58677e; --border: #e2e6ef; --accent: #5f50a6; --accent-soft: #f0ecfb; --nav: #282c43; --nav-text: #d8d9e7; }
body { margin: 0; }
.dashboard-page { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid #8572d0; outline-offset: 3px; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 2; padding: 8px 12px; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--nav); color: white; padding: 0 14px; overflow-y: auto; }
.brand { min-height: 75px; display: flex; align-items: center; gap: 11px; color: inherit; padding: 0 6px; }
.brand:hover, .sidebar nav a:hover, .button:hover { text-decoration: none; }
.brand-logo { object-fit: contain; flex: none; }
.brand strong, .brand small, .provider small { display: block; }
.brand strong { font-size: 16px; }
.brand small, .sidebar-foot { font-size: 12px; }
.sidebar .brand small, .sidebar-foot { color: var(--nav-text); }
.sidebar nav { display: grid; gap: 4px; margin-top: 12px; }
.nav-label { padding: 13px 10px 3px; color: #b8b9d0; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.sidebar nav a { min-height: 42px; display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 7px; color: var(--nav-text); font-weight: 600; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { color: #fff; background: #494064; }
.sidebar nav a[aria-current] { box-shadow: inset 3px 0 #a99be7; }
.sidebar-foot { margin-top: auto; padding: 17px 9px; border-top: 1px solid #454961; }
.topbar { min-height: 64px; background: white; border-bottom: 1px solid var(--border); padding: 10px 27px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.separator { margin-inline: 5px; color: #8290a3; }
.page-link { display: flex; align-items: center; gap: 7px; color: #26364d; min-height: 36px; }
.fb { display: grid; place-items: center; color: white; background: #0866e8; font: 700 18px/1 Arial,sans-serif; width: 22px; height: 22px; border-radius: 5px; flex: none; }
.fb.large { width: 39px; height: 39px; border-radius: 8px; font-size: 27px; }
main { max-width: 1500px; margin: auto; padding: 26px 26px 34px; display: grid; gap: 20px; }
.page-heading, .between { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(25px, 3vw, 32px); line-height: 1.2; letter-spacing: -.025em; }
h2 { font-size: 17px; line-height: 1.35; }
.page-heading p, .card-heading p { margin-top: 5px; color: var(--muted); }
.button { font: inherit; font-size: 13px; font-weight: 650; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.primary { color: white; background: var(--accent); }
.primary:hover { background: #4e418f; }
.secondary { background: var(--accent-soft); color: var(--accent); justify-self: start; }
.notice { display: flex; align-items: center; gap: 13px; padding: 13px 16px; border: 1px solid; border-radius: 9px; }
.notice p { font-size: 13px; }
.notice a { color: inherit; font-weight: 700; margin-left: auto; }
.warning { background: #fff9eb; color: #805214; border-color: #edd9a7; }
.success { background: #e9f8f1; color: #096247; border-color: #c8e8dc; }
.danger { background: #fff0ef; color: #8f231f; border-color: #f3c6c2; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.metric, .card { min-width: 0; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 2px 6px #18283c06; }
.metric { display: flex; gap: 12px; align-items: center; padding: 16px; }
.metric > div { min-width: 0; }
.metric-icon { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.blue { color: #115abe; background: #eaf2ff; }
.teal { color: #08795f; background: #e8f7f2; }
.violet { color: #6b46bd; background: #f2ecff; }
.amber { color: #96601c; background: #fff3db; }
.metric strong { display: block; font-size: clamp(19px, 2vw, 26px); line-height: 1.25; margin: 2px 0; overflow-wrap: anywhere; }
.metric div > span, .metric small, .muted, .provider small { color: var(--muted); font-size: 12px; }
.panels { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panels-single { grid-template-columns: minmax(0, 1fr); }
.card-heading { padding: 17px 18px; border-bottom: 1px solid var(--border); }
.card-heading p { font-size: 13px; }
.card-body { padding: 16px 18px 18px; }
.stack { display: grid; gap: 10px; }
form label, legend { display: block; font-size: 13px; font-weight: 650; }
form input, form textarea, form select { display: block; width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #cbd2e0; border-radius: 7px; background: white; color: inherit; font: inherit; }
form textarea { resize: vertical; }
form label + input, .field-row label { margin-bottom: 4px; }
.field-row { display: grid; gap: 11px; grid-template-columns: repeat(2,minmax(0,1fr)); }
fieldset { min-width: 0; border: 0; padding: 0; margin: 2px 0 0; }
legend { padding: 0; }
.photo-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 172px), 1fr)); gap: 8px; margin-top: 7px; }
.photo-fields label { font-size: 12px; }
.photo-fields input[type="file"] { padding: 5px 7px; font-size: 12px; text-overflow: ellipsis; }
.photo-fields input::file-selector-button { padding: 6px 7px; margin-inline-end: 6px; border: 0; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font: inherit; font-weight: 650; cursor: pointer; }
.form-actions { margin-top: 4px; }
.provider { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; }
.metadata { margin: 0; }
.metadata > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.metadata ol { margin: 0; padding-left: 22px; text-align: left; }
.badge { display: inline-block; white-space: nowrap; border-radius: 100px; padding: 4px 8px; font-weight: 650; font-size: 11px; }
.online { background: #e8f7f2; color: #096247; }
.pending { background: #fff3db; color: #805214; }
summary { cursor: pointer; color: var(--accent); font-weight: 650; min-height: 37px; padding-block: 8px; }
.connection-form { margin: 4px 0 10px; }
.plan-message { white-space: pre-wrap; overflow-wrap: anywhere; background: #f5f8fb; padding: 13px; border-radius: 7px; margin-bottom: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 510px; text-align: left; }
thead { background: #f8fafc; color: #495a70; }
th, td { padding: 11px 18px; border-bottom: 1px solid var(--border); }
tbody tr:last-child > * { border-bottom: 0; }
.empty { text-align: center; padding: 24px 16px; color: var(--muted); }
.empty svg { display: block; margin: 0 auto 7px; color: #657d97; }
.empty span { display: block; font-size: 13px; }
.pagination { padding: 10px 18px; display: flex; justify-content: flex-end; gap: 12px; }
footer { color: var(--muted); font-size: 12px; }
footer span { margin-inline: 4px; }
@media (max-width: 1100px) {
    .dashboard-page { grid-template-columns: 200px minmax(0, 1fr); }
    main, .topbar { padding-inline: 18px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .dashboard-page { display: block; }
    .sidebar { position: static; height: auto; border: 0; border-bottom: 1px solid var(--border); }
    .brand { min-height: 56px; }
    .sidebar .brand-logo { width: 34px; height: 34px; }
    .sidebar nav { margin-top: 0; display: flex; flex-wrap: wrap; padding-bottom: 7px; }
    .nav-label, .sidebar-foot { display: none; }
    .topbar { min-height: 44px; }
    .panels { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    main { padding: 17px 12px 24px; gap: 13px; }
    .page-heading { align-items: start; flex-direction: column; }
    .topbar { padding-inline: 12px; flex-wrap: wrap; }
    .metrics { gap: 8px; }
    .metric { padding: 10px; gap: 7px; align-items: start; }
    .metric-icon { width: 27px; height: 27px; }
    .metric-icon svg { width: 15px; height: 15px; }
    .notice { align-items: start; flex-wrap: wrap; }
    .notice div { flex: 1; }
    .notice a { width: 100%; padding-left: 33px; }
    .field-row { grid-template-columns: 1fr; }
    .table-scroll:not(.wide-table) table { min-width: 0; }
    th, td { padding: 8px 6px; overflow-wrap: anywhere; }
    td .badge { white-space: normal; }
}
.login-page {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 24px;
    background: radial-gradient(circle at 10% 12%, #b9afea9c, transparent 37%),
        radial-gradient(circle at 88% 88%, #90cbed88, transparent 40%),
        linear-gradient(130deg, #ece9ff, #e7f5ff);
}
.login-card { width: min(100%, 470px); padding: clamp(22px, 6vw, 34px); gap: 22px; background: #ffffffdc; border: 1px solid #fff; border-radius: 16px; box-shadow: 0 22px 48px #25345421; }
.login-card .brand { min-height: 0; padding: 0; }
.login-card .brand small, .login-heading p { color: var(--muted); }
.login-card h1 { font-size: clamp(22px, 5vw, 25px); font-weight: 600; margin-bottom: 5px; }
.login-form button { margin-top: 5px; background: linear-gradient(180deg, #8b547e, #5f56a8); box-shadow: 0 8px 20px #6658b333; }
.login-form button:hover { background: linear-gradient(180deg, #77486c, #514890); }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.session-menu { position: relative; }
.session-menu summary { display: flex; align-items: center; gap: 8px; padding: 3px 6px; list-style: none; }
.session-menu summary::-webkit-details-marker { display: none; }
.session-panel { position: absolute; z-index: 3; inset: 100% 0 auto auto; display: grid; gap: 9px; min-width: 180px; max-width: min(300px, 85vw); padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: white; box-shadow: 0 10px 24px #25345423; overflow-wrap: anywhere; }
.section-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.section-tabs a { padding: 9px 13px; border-radius: 7px; }
.section-tabs [aria-current] { background: var(--accent-soft); font-weight: 700; }
.operator-row { padding: 0 18px; border-bottom: 1px solid var(--border); }
.operator-row:last-of-type { border-bottom: 0; }
.operator-row summary { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: inherit; }
.operator-row summary strong { flex: 1 1 180px; overflow-wrap: anywhere; }
.operator-row summary::after { content: ""; display: block; width: 7px; height: 7px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: 0 4px 4px; }
.operator-row[open] summary::after { transform: rotate(225deg); margin-bottom: 0; }
.operator-edit { padding: 8px 0 16px; }
.role-badge { background: var(--accent-soft); color: var(--accent); }
.audit-detail { display: block; color: var(--muted); overflow-wrap: anywhere; }
.wide-table table { min-width: 590px; }
.plan-photos { display: flex; flex-wrap: wrap; gap: 12px; padding-left: 24px; }
.plan-photos img { display: block; width: 112px; height: 90px; object-fit: contain; border-radius: 6px; background: #f4f6fa; }
@media (max-width: 480px) {
    .sidebar nav a { min-height: 40px; gap: 6px; padding: 6px 9px; }
    .sidebar nav a svg { width: 16px; height: 16px; }
    .account-role { display: none; }
    .topbar-actions { margin-left: auto; }
}
