/* ═══════════════════════════════════════════════════════════════
   ReWalk Admin — Styles (from rewalk-admin.svg)
   Border colors: avg(host_bg, element_bg) hue, 20% sat, host L +10%
   ═══════════════════════════════════════════════════════════════ */

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

html, body {
    height: 100%;
    font-family: 'Ubuntu Sans', 'Segoe UI', sans-serif;
    background: #14141d;
    color: #aeaec1;
}

/* ─── Login Layout ─────────────────────────────────────────── */

.login-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #14141d;
}

.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card-header {
    background: #101017;
    border: 0.5px solid #28283c;
    border-bottom: none;
    border-radius: 34px 34px 0 0;
    width: 300px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0c0c11;
    border: 0.5px solid #28283c;
    border-top: none;
    border-radius: 0 0 34px 34px;
    width: 300px;
    height: 442px;
}

.login-header-text {
    background: linear-gradient(90deg, #0088aa, #6223b1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

.login-logo {
    margin-bottom: 8px;
}

.login-logo img {
    height: 80px;
    width: auto;
}

.login-subtitle {
    color: #7977b0;
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.login-input {
    background: #12121a;
    border: 0.5px solid #202030;
    border-radius: 7px;
    padding: 6px 12px;
    color: #aeaec1;
    font-size: 12px;
    outline: none;
    width: 115px;
    height: 30px;
}

.login-input:focus {
    border-color: #a356ff;
}

.login-btn {
    background: #391467;
    border: 0.5px solid #262030;
    border-radius: 7px;
    padding: 6px 12px;
    color: #a356ff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    width: 115px;
    height: 30px;
}

.login-btn:hover {
    background: #4a1a80;
}

/* ─── Admin Layout ─────────────────────────────────────────── */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ──────────────────────────────────────────────── */

.admin-sidebar {
    width: 200px;
    background: linear-gradient(180deg, #1f1f30, #12121a);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 0.5px solid #292a3d;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #0b0b16;
    min-height: 56px;
}

.sidebar-logo {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.sidebar-wordmark {
    height: 18px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.burger-btn {
    margin-left: auto;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.burger-btn img {
    width: 20px;
    height: 20px;
    display: block;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.burger-btn:hover img {
    opacity: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #53536b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
    background: #0e0e17;
    border-bottom: 0.5px solid #2c2d42;
}

/* Icons render via mask-image so the fill inherits the nav-item text color.
   Each .nav-icon-<name> selector points at the matching SVG; the mask + currentColor
   trick lets a single CSS color drive normal / hover / active states uniformly. */
.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.nav-icon-dashboard     { -webkit-mask-image: url('/img/icons/dashboard.svg');     mask-image: url('/img/icons/dashboard.svg'); }
.nav-icon-users         { -webkit-mask-image: url('/img/icons/users.svg');         mask-image: url('/img/icons/users.svg'); }
.nav-icon-clinics       { -webkit-mask-image: url('/img/icons/clinics.svg');       mask-image: url('/img/icons/clinics.svg'); }
.nav-icon-devices       { -webkit-mask-image: url('/img/icons/devices.svg');       mask-image: url('/img/icons/devices.svg'); }
.nav-icon-subscriptions { -webkit-mask-image: url('/img/icons/subscriptions.svg'); mask-image: url('/img/icons/subscriptions.svg'); }
.nav-icon-config        { -webkit-mask-image: url('/img/icons/config.svg');        mask-image: url('/img/icons/config.svg'); }
.nav-icon-jobs          { -webkit-mask-image: url('/img/icons/jobs.svg');          mask-image: url('/img/icons/jobs.svg'); }
.nav-icon-apikeys       { -webkit-mask-image: url('/img/icons/apikeys.svg');       mask-image: url('/img/icons/apikeys.svg'); }
.nav-icon-rebuild       { -webkit-mask-image: url('/img/icons/rebuild.svg');       mask-image: url('/img/icons/rebuild.svg'); }
.nav-icon-themes        { -webkit-mask-image: url('/img/icons/themes.svg');        mask-image: url('/img/icons/themes.svg'); }
.nav-icon-mocap         { -webkit-mask-image: url('/img/icons/mocap.svg');         mask-image: url('/img/icons/mocap.svg'); }
.nav-icon-audit         { -webkit-mask-image: url('/img/icons/audit.svg');         mask-image: url('/img/icons/audit.svg'); }

.nav-item:hover {
    color: #ffffff;
    background: #1e1e30;
}

.nav-item.active {
    color: #ffffff;
    background: #0088aa;
}

/* ─── Nav Group (collapsible section) ───────────────────────── */

.nav-group {
    display: flex;
    flex-direction: column;
    border-bottom: 0.5px solid #2c2d42;
    background: #0e0e17;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    color: #6a6a82;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    cursor: pointer;
    text-align: left;
    text-transform: uppercase;
}

.nav-group-header:hover {
    color: #ffffff;
    background: #161624;
}

.nav-group.open .nav-group-header {
    color: #b0b0c8;
}

.nav-group-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: #8a8aa6;
    font-size: 14px;
    line-height: 1;
}

.nav-group-title {
    flex: 1;
}

.nav-group-items {
    display: flex;
    flex-direction: column;
}

.nav-group-items .nav-item {
    padding-left: 28px;
    border-bottom: none;
    border-top: 0.5px solid #2c2d42;
}

.nav-item-top {
    /* Dashboard sits above the groups; preserve original styling but add a stronger divider. */
    border-bottom: 1px solid #2c2d42;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #2c2d42;
    background: #0b0b16;
}

.nav-item-logout {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: none;
    text-align: left;
    cursor: pointer;
    color: #8a4a5a;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item-logout:hover {
    color: #e57373;
    background: #1f1019;
}

.nav-icon-logout {
    /* Inline logout glyph (door + arrow) via data URI so we don't need another asset. */
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M6 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3v-1H3V3h3V2zm4.7 2.3l-.7.7L11.3 7H5v1h6.3l-1.3 1.3.7.7L13 8 10.7 4.3z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M6 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3v-1H3V3h3V2zm4.7 2.3l-.7.7L11.3 7H5v1h6.3l-1.3 1.3.7.7L13 8 10.7 4.3z'/></svg>");
}

/* ─── Geographic Scope Panel ────────────────────────────────── */

.geo-scope-panel {
    border-bottom: 0.5px solid #2c2d42;
}

.geo-scope-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #12121a;
    cursor: pointer;
    font-size: 10px;
    color: #aeaec1;
}

.geo-scope-header:hover {
    background: #1e1e30;
}

.geo-scope-summary {
    font-weight: 500;
}

.geo-scope-toggle {
    font-size: 8px;
    color: #53536b;
}

.geo-scope-tree {
    padding: 8px 16px;
    background: #0a0a12;
}

.geo-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 10px;
    color: #aeaec1;
    cursor: pointer;
}

.geo-node input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #0088aa;
}

.geo-node-children {
    padding-left: 16px;
}

/* ─── Main Content Area ────────────────────────────────────── */

.admin-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #15151f;
}

.admin-topbar {
    background: #0e0e17;
    padding: 14px 24px;
}

.admin-content {
    flex: 1;
    padding: 0;
}

/* ─── Breadcrumb ───────────────────────────────────────────── */

.page-breadcrumb {
    color: #aeaec1;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 1px;
    padding: 14px 24px;
    background: #0e0e17;
}

/* ─── Dashboard ────────────────────────────────────────────── */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dashboard-card {
    border-radius: 10px;
    overflow: hidden;
    border: 0.5px solid #2f2f46;
}

.dashboard-card-header {
    background: #13131f;
    border-bottom: 0.5px solid #232334;
    padding: 12px 16px;
}

.card-caption {
    color: #403427;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.dashboard-card-body {
    background: #0e0e17;
    padding: 20px 16px;
}

.card-text {
    color: #727285;
    font-size: 12px;
}

/* ─── Page Content (reusable content page structure) ───────── */

.page-content-header {
    background: #0e0e17;
    border: 0.5px solid #29293d;
    border-radius: 10px 10px 0 0;
    padding: 20px 24px;
    margin: 24px 24px 0 24px;
}

.page-heading {
    color: #35354b;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
}

.page-content-body {
    background: #1b1b28;
    border: 0.5px solid #29293d;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 24px;
    margin: 0 24px 24px 24px;
    min-height: 300px;
    color: #b0b0c8;
    font-size: 13px;
}

/* ─── Toolbars + form controls ─────────────────────────────── */

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar-label {
    color: #6a6a82;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.filter-select,
.form-input,
.search-input {
    background: #0e0e17;
    color: #d4d4e8;
    border: 1px solid #2c2d42;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
}

.filter-select:focus,
.form-input:focus,
.search-input:focus {
    border-color: #0088aa;
}

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

/* ─── Buttons ──────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2a2a3d;
    color: #d4d4e8;
    border: 1px solid #2c2d42;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-transform: uppercase;
}

.btn:hover { background: #353550; color: #ffffff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-primary { background: #0088aa; border-color: #0088aa; color: #ffffff; }
.btn-primary:hover { background: #00a3ce; border-color: #00a3ce; }
.btn-success { background: #2e8b57; border-color: #2e8b57; color: #ffffff; }
.btn-success:hover { background: #36a368; border-color: #36a368; }
.btn-danger { background: #8b2e3f; border-color: #8b2e3f; color: #ffffff; }
.btn-danger:hover { background: #a3364a; border-color: #a3364a; }

/* ─── Data table ───────────────────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #15151f;
    border-radius: 6px;
    overflow: hidden;
}

.data-table th {
    text-align: left;
    background: #0e0e17;
    color: #6a6a82;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 10px 12px;
    border-bottom: 1px solid #2c2d42;
}

.data-table td {
    padding: 9px 12px;
    border-bottom: 0.5px solid #232334;
    color: #b0b0c8;
}

.data-table tbody tr:hover { background: #1f1f2e; }
.data-table code { color: #00a3ce; font-family: 'Ubuntu Mono', monospace; font-size: 12px; }

.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Misc state classes ───────────────────────────────────── */

.empty-state {
    color: #6a6a82;
    text-align: center;
    padding: 32px 16px;
    font-style: italic;
    font-size: 13px;
}

.muted { color: #5a5a72; }

/* ─── Get Started (first-run dashboard) ────────────────────── */

.getstarted-panel {
    background: #0e0e17;
    border: 1px solid #2c2d42;
    border-radius: 8px;
    padding: 24px 28px;
}

.getstarted-title {
    color: #aeaeda;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0 0 4px 0;
}

.getstarted-subtitle {
    color: #6a6a82;
    font-size: 12px;
    margin: 0 0 20px 0;
}

.getstarted-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.getstarted-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #15151f;
    border: 0.5px solid #2c2d42;
    border-radius: 6px;
    padding: 14px 18px;
}

.getstarted-item.done {
    background: #121a14;
    border-color: #234a2c;
}

.getstarted-check {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2c2d42;
    border-radius: 50%;
    color: #6a6a82;
    font-size: 14px;
    flex-shrink: 0;
}

.getstarted-item.done .getstarted-check {
    background: #2e8b57;
    border-color: #2e8b57;
    color: #ffffff;
}

.getstarted-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.getstarted-headline {
    color: #d4d4e8;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.getstarted-item.done .getstarted-headline {
    color: #8eb59a;
    text-decoration: line-through;
    text-decoration-color: #2e8b57;
}

.getstarted-detail {
    color: #6a6a82;
    font-size: 11px;
    line-height: 1.4;
}

/* ─── App Releases page ────────────────────────────────────── */

.required-banner {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.required-tile {
    flex: 1;
    min-width: 180px;
    background: #0e0e17;
    border: 0.5px solid #2c2d42;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.required-platform {
    color: #6a6a82;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.required-version {
    color: #0088aa;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Ubuntu Mono', monospace;
}

.required-empty {
    color: #5a5a72;
    font-size: 13px;
    font-style: italic;
}

.required-since {
    color: #6a6a82;
    font-size: 11px;
}

.create-form {
    background: #0e0e17;
    border: 1px solid #2c2d42;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-row label:first-child {
    color: #6a6a82;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    min-width: 80px;
}

.form-row .form-input { flex: 1; max-width: 360px; }

.form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b0b0c8;
    font-size: 12px;
    cursor: pointer;
}

.form-error { color: #e57373; font-size: 12px; }

/* ─── Detail panel (used by CrashReports) ──────────────────── */

.detail-row {
    display: flex;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 0.5px solid #232334;
    font-size: 12px;
}

.detail-label { color: #6a6a82; min-width: 100px; }
.detail-value { color: #d4d4e8; }

.code-block {
    background: #0a0a12;
    color: #d4d4e8;
    border: 0.5px solid #2c2d42;
    border-radius: 4px;
    padding: 12px;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    overflow-x: auto;
    margin-top: 8px;
}
