/* =====================================================
   Fuse Hub — Stylesheet
   Clean corporate styling
   ===================================================== */

:root {
  /* Brand */
  --fuse-navy:        #0f1e3d;
  --fuse-navy-deep:   #0a1530;
  --fuse-slate:       #334155;
  --fuse-accent:      #ff6a13;
  --fuse-accent-dark: #e55a09;

  /* Neutrals */
  --bg:           #f6f8fb;
  --surface:      #ffffff;
  --border:       #e3e8ef;
  --border-soft:  #eef1f6;
  --text:         #1a2540;
  --text-muted:   #5a6779;
  --text-soft:    #8693a8;

  /* Feedback */
  --success-bg:   #e7f7ee;
  --success-tx:   #136b3a;
  --error-bg:     #fdecec;
  --error-tx:     #b3261e;
  --info-bg:      #e8f0fe;
  --info-tx:      #1a4dab;

  /* Layout */
  --radius:       10px;
  --radius-sm:    6px;
  --shadow-sm:    0 1px 2px rgba(15, 30, 61, 0.04);
  --shadow:       0 4px 14px rgba(15, 30, 61, 0.06);
  --shadow-lg:    0 10px 30px rgba(15, 30, 61, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--fuse-navy); text-decoration: none; }
a:hover { color: var(--fuse-accent); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
  background: var(--fuse-navy);
  color: #fff;
  border-bottom: 3px solid var(--fuse-accent);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand:hover { color: #fff; }
.brand-mark {
  font-size: 22px;
  letter-spacing: 0.18em;
  color: #fff;
}
.brand-divider {
  width: 1px; height: 20px; background: rgba(255,255,255,0.3);
}
.brand-name {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.85);
}
.header-nav {
  display: flex; align-items: center; gap: 22px;
}
.nav-link {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav-link:hover { color: #fff; }
.nav-user {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}
.nav-user strong { color: #fff; font-weight: 600; }

/* =====================================================
   MAIN LAYOUT
   ===================================================== */
.main-content { flex: 1; padding: 56px 24px; }
.admin-main   { flex: 1; padding: 40px 24px; }

.hero { text-align: center; margin-bottom: 48px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  font-weight: 700;
  color: var(--fuse-navy);
  letter-spacing: -0.02em;
}
.hero-sub {
  margin: 0;
  font-size: 18px;
  color: var(--text-muted);
}

/* =====================================================
   APP GRID (public hub)
   ===================================================== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--fuse-navy);
  color: var(--text);
}
.app-card-body { padding: 24px 24px 16px; flex: 1; }
.app-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--fuse-navy);
  letter-spacing: -0.01em;
}
.app-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}
.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border-soft);
  background: #fafbfd;
}
.app-url {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.app-arrow {
  font-size: 18px;
  color: var(--fuse-accent);
  transition: transform 0.15s ease;
}
.app-card:hover .app-arrow { transform: translateX(3px); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.empty-state p { margin: 0 0 16px; }

/* =====================================================
   ADMIN
   ===================================================== */
.admin-header { margin-bottom: 28px; }
.admin-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  color: var(--fuse-navy);
  letter-spacing: -0.01em;
}
.admin-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--fuse-navy); }
.tab.is-active {
  color: var(--fuse-navy);
  border-bottom-color: var(--fuse-accent);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
  background: #fafbfd;
}
.panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fuse-navy);
  letter-spacing: 0.01em;
}
.panel-body { padding: 22px; }

/* =====================================================
   FORMS
   ===================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full   { grid-column: span 6; }
.field-half   { grid-column: span 3; }
.field-third  { grid-column: span 2; }
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fuse-navy);
}
.field-hint {
  font-weight: 400;
  color: var(--text-soft);
  font-size: 12px;
  margin-left: 4px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="number"],
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--fuse-navy);
  box-shadow: 0 0 0 3px rgba(15, 30, 61, 0.10);
}
.field textarea { resize: vertical; min-height: 80px; }

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-top: 26px;
  font-size: 14px;
  color: var(--text);
}
.checkbox-field input { width: 18px; height: 18px; }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .field-full, .field-half, .field-third { grid-column: span 1; }
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: 600 14px/1 'Inter', sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--fuse-navy);
  color: #fff;
}
.btn-primary:hover { background: var(--fuse-navy-deep); color: #fff; }

.btn-secondary {
  background: var(--fuse-slate);
  color: #fff;
}
.btn-secondary:hover { background: #1f2a3f; color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--fuse-navy);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--fuse-navy); }

.btn-danger {
  background: #fff;
  color: #b3261e;
  border-color: #e9c5c2;
}
.btn-danger:hover { background: #fdecec; color: #8b1a16; }

.btn-block { width: 100%; }
.btn-sm    { padding: 7px 12px; font-size: 13px; }

/* =====================================================
   TABLES
   ===================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
}
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfd; }

.actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.inline-input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  width: 150px;
}

/* =====================================================
   PILLS / BADGES
   ===================================================== */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill-success { background: var(--success-bg); color: var(--success-tx); }
.pill-info    { background: var(--info-bg);    color: var(--info-tx); }
.pill-muted   { background: #eef1f6; color: var(--text-muted); }

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success-tx); border-color: #b6e3c7; }
.alert-error   { background: var(--error-bg);   color: var(--error-tx);   border-color: #f1c2bf; }
.alert-info    { background: var(--info-bg);    color: var(--info-tx);    border-color: #bfd2f5; }

/* =====================================================
   AUTH PAGES
   ===================================================== */
.auth-body {
  background: linear-gradient(135deg, var(--fuse-navy) 0%, var(--fuse-navy-deep) 100%);
}
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 100vh;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-brand {
  color: var(--fuse-navy);
  margin-bottom: 28px;
}
.auth-brand .brand-mark { color: var(--fuse-navy); }
.auth-brand .brand-divider { background: var(--border); }
.auth-brand .brand-name { color: var(--text-muted); }
.auth-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--fuse-navy);
}
.auth-sub {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.auth-card .field { margin-bottom: 16px; }
.auth-card .btn-block { margin-top: 8px; }
.auth-foot {
  margin: 22px 0 0;
  text-align: center;
  font-size: 13px;
}
.auth-foot a { color: var(--text-muted); }

/* =====================================================
   FOOTER & UTILS
   ===================================================== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.link-muted { color: var(--text-muted); }
.link-muted:hover { color: var(--fuse-accent); }
