/* ===== Open-WebUI-Dark-Theme (Basis aus webmail übernommen) ===== */
:root {
  --bg: #171717;
  --bg-side: #0d0d0d;
  --bg-elev: #212121;
  --bg-input: #262626;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #ececec;
  --text-2: #b4b4b4;
  --text-3: #8e8e8e;
  --text-4: #676767;
  --accent: #3b82f6;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #eab308;
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45; -webkit-font-smoothing: antialiased; }
html { font-size: 14.7px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: #93c5fd; }
h1, h2, h3 { font-weight: 500; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }

/* ===== Basis-Elemente ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: none; cursor: pointer; border-radius: 9999px;
  padding: .5rem 1rem; font-weight: 500; font-size: .875rem; background: var(--bg-input); color: var(--text); transition: background .15s, opacity .15s;
  white-space: nowrap; flex-shrink: 0; text-decoration: none; }
.btn:hover { background: #303030; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e5e5e5; }
.btn-danger { background: rgba(239,68,68,.15); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.3rem; font-size: .95rem; }
.btn svg { width: 1.05rem; height: 1.05rem; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: .6rem; border: none; cursor: pointer;
  background: transparent; color: var(--text-2); transition: background .15s, color .15s; flex-shrink: 0; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn.on { color: var(--text); background: var(--bg-active); }
.icon-btn svg, .nav-item svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }

.input, .select, .textarea { width: 100%; background: var(--bg-input); border: 1px solid transparent; border-radius: var(--radius); padding: .55rem .85rem; outline: none; transition: border-color .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-strong); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: rgba(239,68,68,.6); }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
select { color-scheme: dark; }
select option { background-color: var(--bg-elev); color: var(--text); }
.textarea { resize: vertical; min-height: 5rem; }
.textarea.mono { font-family: var(--mono); font-size: .8rem; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23999'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 1rem; padding-right: 2.2rem; }

label.field { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--text-3); }
label.field > span { padding-left: .2rem; }
.field-error { color: #fca5a5; font-size: .75rem; padding-left: .2rem; }
.row { display: flex; gap: .75rem; }
.row > * { flex: 1; min-width: 0; }
.row > .narrow { flex: 0 0 7rem; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { accent-color: #fff; width: 1rem; height: 1rem; }
.seg { display: inline-flex; background: var(--bg-input); border-radius: 9999px; padding: .15rem; gap: .1rem; }
.seg button { border: none; background: transparent; color: var(--text-3); padding: .3rem .8rem; border-radius: 9999px; cursor: pointer; font-size: .8rem; }
.seg button.on { background: #fff; color: #000; }

.muted { color: var(--text-3); }
.small { font-size: .8rem; }
.tiny { font-size: .72rem; }
.mono { font-family: var(--mono); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: .5rem 0; }
.error-box { background: rgba(239,68,68,.12); color: #fca5a5; padding: .6rem .9rem; border-radius: var(--radius); font-size: .85rem; }
.info-box { background: rgba(59,130,246,.12); color: #bfdbfe; padding: .6rem .9rem; border-radius: var(--radius); font-size: .85rem; }
.warn-box { background: rgba(234,179,8,.1); color: #fde68a; padding: .6rem .9rem; border-radius: var(--radius); font-size: .85rem; }

/* ===== Login ===== */
.auth-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 24rem; display: flex; flex-direction: column; gap: 1rem; }
.auth-logo { display: flex; align-items: center; gap: .6rem; justify-content: center; font-size: 1.6rem; font-weight: 600; margin-bottom: .5rem; }
.auth-logo .logo { width: 2.2rem; height: 2.2rem; }
.auth-card .input { padding: .75rem 1rem; }
.auth-card .btn { padding: .75rem; }
.auth-switch { text-align: center; font-size: .85rem; color: var(--text-3); }
.auth-switch button { background: none; border: none; color: var(--text); cursor: pointer; text-decoration: underline; }
.lang-switch { position: fixed; top: 1rem; right: 1rem; }

/* ===== Layout ===== */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: 260px; flex-shrink: 0; background: var(--bg-side); display: flex; flex-direction: column; transition: margin-left .2s ease; border-right: 1px solid rgba(255,255,255,0.03); z-index: 40; }
.sidebar.collapsed { margin-left: -260px; }
.sidebar-top { padding: .6rem .6rem .25rem; display: flex; flex-direction: column; gap: .15rem; position: relative; }
.brand { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem .6rem; font-weight: 600; font-size: 1rem; }
.brand .logo { width: 1.5rem; height: 1.5rem; }
.sidebar-search { display: flex; align-items: center; gap: .45rem; margin: .2rem 0 .1rem; padding: .3rem .6rem; background: transparent; border-radius: .6rem; }
.sidebar-search:focus-within { background: var(--bg-input); }
.sidebar-search svg { width: .95rem; height: .95rem; color: var(--text-3); flex-shrink: 0; }
.sidebar-search input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; font-size: .85rem; padding: .15rem 0; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: .25rem .6rem 1rem; }
.sidebar-section { margin-top: .9rem; }
.sidebar-label { font-size: .72rem; font-weight: 500; color: var(--text-4); padding: .2rem .55rem .35rem; display: flex; align-items: center; gap: .3rem; }
.sidebar-label .icon-btn { width: 1.4rem; height: 1.4rem; margin-left: auto; }
.sidebar-label .icon-btn svg { width: .9rem; height: .9rem; }
.sidebar-backdrop { display: none; }

.nav-item { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .45rem .55rem; border-radius: .6rem; border: none; background: transparent;
  color: var(--text-2); cursor: pointer; text-align: left; font-size: .875rem; transition: background .12s, color .12s; position: relative; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--bg-active); color: var(--text); }
.nav-item.sub { padding-left: 1.9rem; font-size: .83rem; }
.nav-item.sub svg { width: .95rem; height: .95rem; }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .sub-label { color: var(--text-4); font-size: .72rem; }
.nav-item .hover-actions { display: none; margin-left: auto; }
.nav-item:hover .hover-actions, .nav-item.menu-open .hover-actions { display: flex; }
.nav-item .hover-actions .icon-btn { width: 1.5rem; height: 1.5rem; }
.nav-item .hover-actions .icon-btn svg { width: .95rem; height: .95rem; }
.nav-item.disabled { opacity: .45; }
.chev { width: .85rem !important; height: .85rem !important; transition: transform .15s; color: var(--text-4); }
.chev.open { transform: rotate(90deg); }

.status-dot { width: .5rem; height: .5rem; border-radius: 9999px; background: var(--text-4); flex-shrink: 0; }
.status-dot.online { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .12); }
.status-dot.busy { background: #facc15; }

.new-btn { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .6rem; border-radius: .6rem; border: none; background: transparent; color: var(--text); cursor: pointer; font-weight: 500; }
.new-btn:hover { background: var(--bg-hover); }
.new-btn .plus { width: 1.6rem; height: 1.6rem; border-radius: 9999px; background: #fff; color: #000; display: flex; align-items: center; justify-content: center; }
.new-btn .plus svg { width: 1rem; height: 1rem; }

.sidebar-bottom { padding: .5rem .6rem .7rem; position: relative; }
.user-btn { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem; border-radius: .7rem; border: none; background: transparent; cursor: pointer; color: var(--text); text-align: left; }
.user-btn:hover { background: var(--bg-hover); }
.avatar { width: 2rem; height: 2rem; border-radius: 9999px; background: linear-gradient(135deg, #6366f1, #ec4899); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; color: #fff; flex-shrink: 0; text-transform: uppercase; overflow: hidden; }

.menu { position: absolute; z-index: 60; min-width: 13rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .3rem; display: flex; flex-direction: column; }
.menu button, .menu a { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border-radius: .55rem; border: none; background: none; cursor: pointer; text-align: left; color: var(--text); font-size: .85rem; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--bg-hover); }
.menu button svg { width: 1rem; height: 1rem; color: var(--text-3); }
.menu .danger { color: #fca5a5; }
.menu .danger svg { color: #fca5a5; }
.menu .menu-sep { height: 1px; background: var(--border); margin: .25rem .3rem; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); position: relative; }
.topbar { height: 3.25rem; display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; flex-shrink: 0; }
.topbar h1 { font-size: 1.05rem; font-weight: 500; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { flex: 1; overflow-y: auto; padding: 1rem 1.5rem 3rem; }
.page-inner { max-width: 56rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; flex: 1; color: var(--text-4); padding: 2rem; text-align: center; }
.empty svg { width: 3rem; height: 3rem; opacity: .5; }

/* ===== Startseite (wie OpenWebUI-Begrüßung) ===== */
.hero { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 3rem 1rem 1rem; text-align: center; }
.hero .logo { width: 3rem; height: 3rem; }
.hero h2 { font-size: 1.9rem; margin: 0; font-weight: 500; }
.hero p { margin: 0; color: var(--text-3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.tile { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; display: flex; flex-direction: column; gap: .5rem; cursor: pointer; transition: background .15s, border-color .15s; text-align: left; color: var(--text); }
.tile:hover { background: #262626; border-color: var(--border-strong); }
.tile .tile-head { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.tile .tile-head svg { width: 1.15rem; height: 1.15rem; color: var(--text-3); flex-shrink: 0; }
.tile .tile-title { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tile-sub { font-size: .78rem; color: var(--text-3); }
.tile .tile-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.section-title { font-size: .8rem; color: var(--text-3); font-weight: 500; margin: 0 0 -.4rem .2rem; }

/* ===== Geräteansicht ===== */
.device-head { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.device-head .os-icon { width: 3rem; height: 3rem; border-radius: 1rem; background: var(--bg-input); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.device-head .os-icon svg { width: 1.6rem; height: 1.6rem; color: var(--text-2); }
.device-head h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .55rem; }
.meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; color: var(--text-3); margin-top: .25rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.list { display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .65rem .9rem; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row svg { width: 1.05rem; height: 1.05rem; color: var(--text-3); flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; padding: .1rem .5rem; border-radius: 9999px; background: var(--bg-input); color: var(--text-2); white-space: nowrap; }
.badge.green { background: rgba(34,197,94,.14); color: #86efac; }
.badge.yellow { background: rgba(234,179,8,.14); color: #fde68a; }
.badge.red { background: rgba(239,68,68,.14); color: #fca5a5; }
.badge.blue { background: rgba(59,130,246,.15); color: #93c5fd; }

/* ===== Sitzungen ===== */
.session { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; z-index: 5; }
.session-bar { display: flex; align-items: center; gap: .35rem; padding: .35rem .6rem; background: var(--bg); border-bottom: 1px solid var(--border); min-height: 2.9rem; flex-shrink: 0; position: relative; }
.session-bar .title { font-weight: 500; font-size: .9rem; display: flex; align-items: center; gap: .45rem; min-width: 0; }
.session-bar .icon-btn { width: 2.1rem; height: 2.1rem; }
.session-bar .sep { width: 1px; height: 1.4rem; background: var(--border-strong); margin: 0 .2rem; }
.session-stage { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; outline: none; }
.session-stage.original { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.session-stage video, .session-stage canvas { display: block; max-width: 100%; max-height: 100%; object-fit: contain; cursor: default; }
.session-stage.original video, .session-stage.original canvas { max-width: none; max-height: none; }
.session-stage.hide-cursor video, .session-stage.hide-cursor canvas { cursor: none; }
.session-stage.drag-over::after { content: attr(data-drop); position: absolute; inset: 1rem; border: 2px dashed rgba(255,255,255,.4); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); color: #fff; font-size: 1.1rem; pointer-events: none; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(23,23,23,.92); z-index: 10; padding: 1rem; }
.overlay-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.5rem; width: 100%; max-width: 24rem; display: flex; flex-direction: column; gap: .9rem; text-align: center; align-items: center; }
.overlay-card h3 { margin: 0; font-size: 1.1rem; }
.overlay-card p { margin: 0; color: var(--text-3); font-size: .88rem; }
.overlay-card .input { text-align: center; letter-spacing: .4em; font-size: 1.3rem; }
.overlay-card .spinner { width: 2rem; height: 2rem; }
.overlay-card .fp { font-family: var(--mono); font-size: .75rem; word-break: break-all; background: #111; padding: .5rem .7rem; border-radius: .5rem; color: var(--text-2); width: 100%; }
.terminal-host { flex: 1; min-height: 0; padding: .4rem .2rem .2rem .6rem; background: #171717; }
.terminal-host .xterm { height: 100%; }
.terminal-host .xterm-viewport { background: #171717 !important; }

.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(28rem, 100%); background: var(--bg-elev); border-left: 1px solid var(--border); box-shadow: var(--shadow); z-index: 20; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: .4rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: .95rem; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; }
.fb { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }
.fb-bar { display: flex; align-items: center; gap: .3rem; padding: .4rem .6rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.fb-path { flex: 1; min-width: 8rem; font-family: var(--mono); font-size: .8rem; background: var(--bg-input); border: 1px solid transparent; border-radius: .5rem; padding: .35rem .6rem; outline: none; }
.fb-path:focus { border-color: var(--border-strong); }
.fb-list { flex: 1; overflow-y: auto; }
.fb-row { display: flex; align-items: center; gap: .6rem; padding: .4rem .75rem; cursor: default; font-size: .85rem; border-bottom: 1px solid rgba(255,255,255,.03); }
.fb-row:hover { background: var(--bg-hover); }
.fb-row.dir { cursor: pointer; }
.fb-row svg { width: 1rem; height: 1rem; color: var(--text-3); flex-shrink: 0; }
.fb-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-row .size, .fb-row .date { color: var(--text-4); font-size: .75rem; white-space: nowrap; }
.fb-row .date { width: 8.5rem; text-align: right; }
.fb-row .size { width: 5rem; text-align: right; }
.fb-row .row-actions { display: none; gap: .1rem; }
.fb-row:hover .row-actions { display: flex; }
.fb-row .row-actions .icon-btn { width: 1.6rem; height: 1.6rem; }
@media (hover: none) { .fb-row .row-actions { display: flex; } }
@media (max-width: 640px) { .fb-row .date { display: none; } }

.transfers { position: absolute; left: 1rem; bottom: 1rem; z-index: 25; display: flex; flex-direction: column; gap: .4rem; width: min(22rem, calc(100% - 2rem)); }
.transfer { background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: .5rem .7rem; font-size: .8rem; display: flex; flex-direction: column; gap: .3rem; box-shadow: var(--shadow); }
.transfer .t-head { display: flex; align-items: center; gap: .4rem; }
.transfer .t-head .ellipsis { flex: 1; }
.progress { height: 4px; background: var(--bg-input); border-radius: 9999px; overflow: hidden; }
.progress > div { height: 100%; background: #fff; transition: width .2s; }
.transfer.error .progress > div { background: var(--danger); }

/* ===== Modals ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; max-width: 32rem; max-height: 92vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 52rem; }
.modal.xwide { max-width: 64rem; }
.modal-head { display: flex; align-items: center; padding: 1rem 1.25rem .5rem; }
.modal-head h2 { margin: 0; font-size: 1.1rem; font-weight: 500; flex: 1; }
.modal-body { padding: .5rem 1.25rem 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: .85rem; }
.modal-foot { display: flex; gap: .5rem; justify-content: flex-end; padding: .75rem 1.25rem 1.1rem; }
.settings { display: flex; min-height: 26rem; }
.settings-nav { width: 12rem; padding: .25rem .75rem 1rem; display: flex; flex-direction: column; gap: .1rem; flex-shrink: 0; }
.settings-body { flex: 1; padding: .25rem 1.25rem 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: .85rem; max-height: 70vh; min-width: 0; }
.settings-body h3 { margin: .2rem 0 0; font-size: .95rem; }
@media (max-width: 700px) {
  .settings { flex-direction: column; }
  .settings-nav { width: auto; flex-direction: row; overflow-x: auto; }
}
.card { background: var(--bg-input); border-radius: var(--radius); padding: .75rem .9rem; display: flex; align-items: center; gap: .75rem; }
.card .grow { flex: 1; min-width: 0; }
.code { font-family: var(--mono); font-size: .82rem; background: #111; padding: .55rem .75rem; border-radius: .55rem; word-break: break-all; user-select: all; display: flex; align-items: center; gap: .5rem; }
.code > span { flex: 1; min-width: 0; }
.big-code { font-family: var(--mono); font-size: 2rem; letter-spacing: .15em; text-align: center; padding: .9rem; background: #111; border-radius: var(--radius); user-select: all; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); }
.tabs button { border: none; background: none; color: var(--text-3); padding: .45rem .8rem; cursor: pointer; border-bottom: 2px solid transparent; font-size: .85rem; }
.tabs button.on { color: var(--text); border-bottom-color: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.table th { text-align: left; color: var(--text-3); font-weight: 500; padding: .45rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.switch { position: relative; width: 2.3rem; height: 1.3rem; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--bg-input); border-radius: 9999px; cursor: pointer; transition: background .15s; border: 1px solid var(--border-strong); }
.switch span::before { content: ""; position: absolute; width: .95rem; height: .95rem; left: .15rem; top: .12rem; background: var(--text-3); border-radius: 9999px; transition: transform .15s, background .15s; }
.switch input:checked + span { background: #fff; }
.switch input:checked + span::before { transform: translateX(.95rem); background: #000; }
.switch input:disabled + span { opacity: .4; cursor: default; }

/* ===== Toasts ===== */
.toasts { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; pointer-events: none; max-width: min(28rem, calc(100vw - 2rem)); }
.toast { background: var(--bg-elev); border: 1px solid var(--border-strong); padding: .6rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); font-size: .85rem; pointer-events: auto; display: flex; gap: .6rem; align-items: center; }
.toast.error { border-color: rgba(239,68,68,.5); color: #fca5a5; }
.toast.success { border-color: rgba(34,197,94,.4); }

.spinner { width: 1.2rem; height: 1.2rem; border: 2px solid rgba(255,255,255,.15); border-top-color: #fff; border-radius: 9999px; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 1.9rem; border-radius: .6rem; margin: .2rem 0; background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: load 1.4s linear infinite; }
@keyframes load { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ===== Mobil ===== */
@media (max-width: 799px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; box-shadow: var(--shadow); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .page { padding: .75rem .9rem 2rem; }
  .toasts { right: 1rem; left: 1rem; bottom: 1rem; align-items: stretch; max-width: none; }
  .hide-mobile { display: none !important; }
}
