:root {
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-soft: rgba(10, 132, 255, 0.14);
  --accent-glow: rgba(255, 255, 255, 0.04);
  --bg: #000;
  --bg-elevated: #1c1c1e;
  --panel: rgba(28, 28, 30, 0.88);
  --panel-solid: #2c2c2e;
  --glass: rgba(28, 28, 30, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-secondary: rgba(235, 235, 245, 0.72);
  --muted: #8e8e93;
  --success: #30d158;
  --danger: #ff453a;
  --info: #0a84ff;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-icon: 18px;
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 48px rgba(0, 0, 0, 0.35);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-family: var(--font);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

a {
  color: inherit;
}

.tablet-bg {
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, var(--accent-glow), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(39, 39, 42, 0.35), transparent 50%),
    var(--bg);
}

.glass-panel {
  background: rgba(14, 15, 20, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.glass-panel-strong {
  background: rgba(14, 15, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
}

.tablet-animate-in {
  animation: tabletFadeIn 0.42s var(--ease-out) both;
}

@keyframes tabletFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tabletPulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.ghost-button,
.primary-button,
.secondary-button,
.danger-button {
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.18s var(--ease-out), background 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.primary-button {
  background: linear-gradient(145deg, var(--accent), #d91e36);
  color: white;
  box-shadow: 0 8px 24px rgba(255, 48, 72, 0.28);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(145deg, var(--accent-hover), #e6223b);
}

.secondary-button {
  background: var(--accent-soft);
  color: #ffd0d6;
  border: 1px solid rgba(255, 48, 72, 0.28);
}

.danger-button {
  background: rgba(255, 95, 109, 0.14);
  color: #ffb3bc;
  border: 1px solid rgba(255, 95, 109, 0.35);
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ffb3be;
  background: rgba(255, 48, 72, 0.1);
  border: 1px solid rgba(255, 48, 72, 0.22);
  transition: background 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}

.icon-button:hover {
  background: rgba(255, 48, 72, 0.22);
  transform: scale(1.04);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

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

@media (max-width: 1100px) {
  .card-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .card-grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: rgba(18, 19, 24, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card h2,
.card h3 {
  margin: 0 0 8px;
}

.stat-card {
  display: grid;
  gap: 8px;
}

.stat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: #ffd0d6;
}

.stat-value {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: #ffb3be;
  font-size: 0.78rem;
  font-weight: 600;
}

.pill-success {
  background: rgba(94, 224, 154, 0.14);
  color: var(--success);
}

.pill-info {
  background: rgba(124, 184, 255, 0.14);
  color: var(--info);
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.section-lead {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.tablet-input,
.tablet-select,
.tablet-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 11px 14px;
  transition: border-color 0.18s var(--ease-out);
}

.tablet-input:focus,
.tablet-select:focus,
.tablet-textarea:focus {
  outline: none;
  border-color: rgba(255, 48, 72, 0.5);
}

.tablet-label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.amount-positive {
  color: var(--success);
}

.amount-negative {
  color: var(--danger);
}

/* App shell (RubyNET / Duty) */
.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  min-height: 100%;
}

.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 0;
  height: 100%;
}

.app-layout-full {
  grid-template-columns: 1fr;
}

.app-sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: none;
  padding: 12px 10px 14px;
  overflow-y: auto;
}

.app-sidebar-nav {
  display: grid;
  gap: 4px;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.app-nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.app-nav-item-active {
  color: white;
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.app-nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.app-nav-item-active .app-nav-icon {
  background: rgba(255, 48, 72, 0.22);
  color: #ffd0d6;
}

.app-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  overflow: hidden;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 13, 0.94);
}

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

.app-content {
  overflow-y: auto;
  padding: 20px 22px 28px;
}

.app-view[hidden] {
  display: none !important;
}

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

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

@media (max-width: 760px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
  }

  .vehicle-grid {
    grid-template-columns: 1fr;
  }
}

.vehicle-card {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  transition: transform 0.22s var(--ease-out), border-color 0.22s var(--ease-out);
}

.vehicle-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 48, 72, 0.35);
}

.vehicle-card-image {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(145deg, rgba(255, 48, 72, 0.12), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.08), transparent 60%);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
}

.vehicle-card-body {
  padding: 14px 16px 16px;
  display: grid;
  gap: 10px;
}

.vehicle-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.vehicle-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 0.8rem;
}

.vehicle-meta-grid dt {
  margin: 0;
  color: var(--muted);
}

.vehicle-meta-grid dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.vehicle-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.vehicle-card-actions button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.vehicle-card-actions button:hover {
  border-color: rgba(255, 48, 72, 0.35);
  color: white;
}

.property-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.news-list {
  display: grid;
  gap: 10px;
}

.news-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: rgba(255, 48, 72, 0.06);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.table tr:last-child td {
  border-bottom: 0;
}

/* —— Tablet: Scrollbars ausblenden (Scrollen per Mausrad/Touch bleibt) —— */
body.tablet-bg,
body.ruby-hub,
body.ruby-app,
body.blacknet-app,
body.tablet-bg *,
body.ruby-hub *,
body.ruby-app *,
body.blacknet-app * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.tablet-bg *::-webkit-scrollbar,
body.ruby-hub *::-webkit-scrollbar,
body.ruby-app *::-webkit-scrollbar,
body.blacknet-app *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* —— Tablet: In-NUI Dialoge (ersetzt window.confirm/prompt) —— */
body.tablet-dialog-open {
  overflow: hidden;
}

.tablet-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tablet-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.tablet-dialog-sheet {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 22, 0.96);
  box-shadow: var(--shadow-soft);
}

.tablet-local-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 100001;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.86rem;
  background: rgba(28, 28, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
}

.tablet-dialog-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.tablet-dialog-message {
  margin: 0 0 18px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.tablet-dialog-input {
  width: 100%;
  margin: 0 0 18px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.tablet-dialog-input:focus {
  outline: none;
  border-color: var(--border-strong);
}

.tablet-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.tablet-dialog-btn {
  min-width: 96px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}

.tablet-dialog-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.tablet-dialog-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

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

.tablet-dialog-btn--danger {
  background: #be123c;
  color: #fff;
}

.tablet-dialog-btn--danger:hover {
  background: #e11d48;
}

/* iOS-style home indicator — shell overlay + hub (#system-home) */
.tablet-home-indicator,
.system-home {
  position: absolute;
  z-index: 120;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(280px, 52vw);
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tablet-home-indicator::after,
.system-home::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%);
  width: min(220px, 88%);
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.55);
  transition: transform 0.12s ease, background 0.12s ease, width 0.12s ease;
  pointer-events: none;
}

.tablet-home-indicator:hover::after,
.system-home:hover::after {
  background: rgba(255, 255, 255, 0.96);
  width: min(236px, 94%);
}

.tablet-home-indicator:active::after,
.system-home:active::after {
  transform: translateX(-50%) scaleY(0.86);
  background: rgba(255, 255, 255, 0.68);
}

.tablet-home-indicator[hidden],
.system-home[hidden] {
  display: none !important;
}
