/* ==========================================================================
   fakturus.formular — App Dashboard Theme
   Dark theme matching the landing page design language.
   Applied via MainLayout wrapper class .app-shell
   ========================================================================== */

.app-shell {
  --bg-deep: #060a12;
  --bg-base: #0a0e17;
  --bg-surface: #111827;
  --bg-elevated: #1e293b;
  --border: #334155;
  --border-subtle: #1e293b;

  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.12);
  --cyan: #22d3ee;
  --red: #ef4444;

  --text-headline: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #64748b;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle background texture */
.app-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(245,158,11,0.03), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ===== APP HEADER ===== */
.app-shell .app-header {
  background: rgba(6, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 50;
}
.app-shell .app-header a {
  text-decoration: none;
}
.app-shell .app-header .app-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-headline);
  letter-spacing: -0.02em;
}
.app-shell .app-header .app-logo span {
  color: var(--amber);
}
.app-shell .app-header .app-logo-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  margin-right: 8px;
  vertical-align: middle;
}
.app-shell .app-nav-link {
  color: var(--text-muted) !important;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.app-shell .app-nav-link:hover {
  color: var(--text-headline) !important;
  background: var(--bg-elevated);
}
.app-shell .app-nav-link.active {
  color: var(--amber) !important;
  background: var(--amber-glow);
}
.app-shell .app-user-name {
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== APP CONTENT ===== */
.app-shell .app-content {
  position: relative;
  z-index: 1;
}

/* ===== APP FOOTER ===== */
.app-shell .app-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  position: relative;
  z-index: 1;
}
.app-shell .app-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.app-shell .app-footer a:hover {
  color: var(--text-headline);
}
.app-shell .app-footer .app-copyright {
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== OVERRIDES for Tailwind classes inside dark theme ===== */

/* Headings */
.app-shell h1, .app-shell h2, .app-shell h3 {
  color: var(--text-headline);
  font-family: var(--font-display);
}

/* Links */
.app-shell a:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.app-nav-link) {
  color: var(--amber);
}
.app-shell a:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.app-nav-link):hover {
  color: var(--amber-light);
}

/* Cards */
.app-shell .card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  color: var(--text-body);
}
.app-shell .card:hover {
  border-color: var(--border);
}

/* Buttons */
.app-shell .btn-primary {
  background: var(--amber) !important;
  color: var(--bg-deep) !important;
  font-weight: 600;
  border: none;
  transition: all 0.25s;
}
.app-shell .btn-primary:hover {
  background: var(--amber-light) !important;
  box-shadow: 0 0 16px var(--amber-glow);
  transform: translateY(-1px);
}
.app-shell .btn-secondary {
  background: transparent !important;
  color: var(--text-headline) !important;
  border: 1px solid var(--border) !important;
  font-weight: 600;
  transition: all 0.25s;
}
.app-shell .btn-secondary:hover {
  border-color: var(--amber) !important;
  box-shadow: 0 0 12px var(--amber-glow);
}
.app-shell .btn-danger {
  background: var(--red) !important;
  color: white !important;
}

/* Inputs */
.app-shell .input-field,
.app-shell input[type="text"],
.app-shell input[type="email"],
.app-shell input[type="url"],
.app-shell input[type="password"],
.app-shell input[type="number"],
.app-shell textarea,
.app-shell select {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-headline) !important;
  border-radius: 8px;
}
.app-shell .input-field:focus,
.app-shell input:focus,
.app-shell textarea:focus,
.app-shell select:focus {
  border-color: var(--amber) !important;
  box-shadow: 0 0 0 2px var(--amber-glow) !important;
  outline: none !important;
}
.app-shell .input-field::placeholder,
.app-shell input::placeholder,
.app-shell textarea::placeholder {
  color: var(--text-muted) !important;
}

/* Tables */
.app-shell table {
  color: var(--text-body);
}
.app-shell thead {
  background: var(--bg-elevated) !important;
}
.app-shell thead th {
  color: var(--text-muted) !important;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.app-shell tbody tr {
  border-bottom: 1px solid var(--border-subtle);
}
.app-shell tbody tr:hover {
  background: var(--bg-elevated) !important;
}
.app-shell td {
  color: var(--text-body) !important;
}

/* Labels */
.app-shell label {
  color: var(--text-body);
}

/* Text color overrides (Tailwind uses text-gray-*) */
.app-shell .text-gray-900 { color: var(--text-headline) !important; }
.app-shell .text-gray-800 { color: var(--text-headline) !important; }
.app-shell .text-gray-700 { color: var(--text-body) !important; }
.app-shell .text-gray-600 { color: var(--text-body) !important; }
.app-shell .text-gray-500 { color: var(--text-muted) !important; }
.app-shell .text-gray-400 { color: var(--text-muted) !important; }
.app-shell .text-gray-300 { color: var(--text-muted) !important; }

/* Background overrides */
.app-shell .bg-gray-50 { background: var(--bg-elevated) !important; }
.app-shell .bg-gray-100 { background: var(--bg-elevated) !important; }
.app-shell .bg-white { background: var(--bg-surface) !important; }

/* Border overrides */
.app-shell .border-gray-200 { border-color: var(--border-subtle) !important; }
.app-shell .border-gray-300 { border-color: var(--border) !important; }
.app-shell .divide-gray-200 > * + * { border-color: var(--border-subtle) !important; }

/* Subscription card overrides */
.app-shell .bg-blue-50 { background: rgba(37,99,235,0.08) !important; }
.app-shell .border-blue-200 { border-color: rgba(37,99,235,0.25) !important; }
.app-shell .border-blue-300 { border-color: rgba(37,99,235,0.2) !important; }

/* Status badges */
.app-shell .bg-green-100 { background: var(--emerald-glow) !important; }
.app-shell .text-green-800 { color: var(--emerald) !important; }
.app-shell .bg-red-100 { background: rgba(239,68,68,0.12) !important; }
.app-shell .text-red-800 { color: var(--red) !important; }
.app-shell .bg-red-50 { background: rgba(239,68,68,0.08) !important; }

/* Warning / Info sections */
.app-shell .bg-yellow-50 { background: rgba(245,158,11,0.08) !important; }
.app-shell .border-yellow-200 { border-color: rgba(245,158,11,0.25) !important; }

/* Spinner */
.app-shell .border-primary-500 { border-color: var(--amber) !important; }

/* Hover shadows */
.app-shell .hover\:shadow-lg:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
}

/* Code blocks */
.app-shell code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--cyan);
}
.app-shell pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}
.app-shell pre code {
  background: none;
  padding: 0;
}

/* Accordion borders in edit pages */
.app-shell .border-gray-200.rounded-lg {
  border-color: var(--border) !important;
}
.app-shell .border-t.border-gray-200 {
  border-color: var(--border-subtle) !important;
}

/* Checkbox styling */
.app-shell input[type="checkbox"] {
  accent-color: var(--amber);
}

/* Pagination */
.app-shell .opacity-50 { opacity: 0.4; }

/* Toast overrides */
.app-shell .blazored-toast { font-family: var(--font-body); }
