/* theme.css
   Global enterprise theme for Asset Manager
*/

:root{
  --bg-1: #f4f7fb;
  --bg-2: #e8eef6;
  --bg-3: #dfe8f2;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --panel-strong: #eef3f8;
  --text: #142033;
  --text-soft: #42526b;
  --muted: #6f7f95;
  --border: #d8e1ec;
  --border-strong: #c5d1df;
  --accent: #0f4c81;
  --accent-600: #0b3a63;
  --accent-700: #092d4b;
  --accent-soft: #e6eef7;
  --success: #0f766e;
  --success-soft: #dff5ef;
  --danger: #c2410c;
  --danger-soft: #feeee5;
  --warning: #b7791f;
  --warning-soft: #fdf1d9;
  --shadow-sm: 0 8px 18px rgba(17, 35, 62, 0.05);
  --shadow-md: 0 18px 40px rgba(17, 35, 62, 0.08);
  --shadow-lg: 0 28px 64px rgba(17, 35, 62, 0.12);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --gap-xs: 8px;
  --gap-sm: 14px;
  --gap: 20px;
  --gap-lg: 32px;
  --font-sans: "Aptos", "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --text-size-base: 14px;
  --text-size-lg: 16px;
}

/* Respect user motion preference */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* -------------------------
   2. Base styles
   ------------------------- */
* { box-sizing: border-box; }
html,body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-size-base);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 76, 129, 0.07), transparent 28%),
    radial-gradient(circle at top right, rgba(11, 58, 99, 0.05), transparent 24%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 54%, var(--bg-3) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

/* layout container */
.container {
  max-width: 1240px;
  margin: 20px auto;
  padding: 0 20px 20px;
}

/* headings */
h1,h2,h3,h4 { color: var(--text); margin: 0 0 8px 0; font-weight: 800; }
h1 { font-size: 24px; letter-spacing: -0.03em; }
h2 { font-size: 20px; letter-spacing: -0.02em; }

/* links */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* small text */
.small { font-size: 13px; color: var(--muted); }
.small-muted { font-size: 13px; color: var(--muted); }
.title-lg { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; color: var(--text); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* -------------------------
   3. Navigation / header
   ------------------------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  padding: 14px 18px;
  border-radius: 0 0 18px 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), transparent 30%),
    linear-gradient(90deg, var(--accent-700), var(--accent), #235f94);
  color: #fff;
  box-shadow: 0 20px 50px rgba(11, 45, 75, 0.2);
}

/* left cluster (back + title) */
.nav-left { display:flex; align-items:center; gap:14px; }

/* site badge */
.site-badge { display:flex; gap:12px; align-items:center; }
.site-logo {
  width:40px; height:40px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05));
  color: #fff; font-weight:800; font-size:15px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}
.site-title { font-weight:800; font-size:16px; color:#fff; letter-spacing: -0.03em; }

/* back button (left) */
.back-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight:700;
  display:inline-flex;
  gap:10px;
  align-items:center;
  cursor:pointer;
}
.back-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.14); }

/* -------------------------
   4. Cards
   ------------------------- */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 26px;
  border: 1px solid rgba(197, 209, 223, 0.72);
  box-shadow: var(--shadow-lg);
  overflow: visible;
}

/* top-row inside card with title + actions */
.top-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* -------------------------
   5. Buttons
   ------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  transition: transform .14s ease, box-shadow .14s ease, opacity .08s, background-color .14s ease;
}

/* primary button (bright blue) */
.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-600));
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 76, 129, 0.2);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(15, 76, 129, 0.24); }

/* secondary / ghost */
.btn-secondary {
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
}
.btn-secondary:hover {
  background: var(--panel-soft);
  box-shadow: var(--shadow-sm);
}
.btn-danger {
  background: linear-gradient(90deg, #b45309, var(--danger));
  color: #fff;
}

/* small action */
.btn-sm { padding: 6px 10px; font-size: 13px; }

/* disabled */
.btn[disabled], .btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* -------------------------
   6. Forms
   ------------------------- */
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
label { display:block; font-weight:700; color: #374151; margin-bottom:6px; font-size:13px; }
input, textarea, select {
  width:100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color .12s ease, box-shadow .12s ease, transform .06s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.12);
  transform: translateY(-1px);
}
textarea { min-height: 120px; resize: vertical; }

/* helper text */
.helper { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* -------------------------
   7. Table styles
   ------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: 14px;
  overflow: auto;
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  font-size: 14px;
  color: var(--text);
}
.table thead th {
  background: var(--panel-soft);
  position: sticky;
  top: 0;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.table tbody tr:hover { background: #f8fbfe; }

/* table small text */
.table .muted { color: var(--muted); font-size: 13px; }

/* -------------------------
   8. Badges & status
   ------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 240px;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 9999;
  font-weight: 700;
  color: #fff;
}
.toast.success { background: linear-gradient(90deg, #0f766e, #0b5f58); }
.toast.error { background: linear-gradient(90deg, #c2410c, #9a3412); }
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 999px;
  display: inline-block;
  animation: spin .8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .navbar {
    padding: 16px 18px;
    border-radius: 0 0 18px 18px;
  }

  .container {
    margin: 24px auto;
    padding: 0 16px 24px;
  }

  .card {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
.badge.success { background: rgba(5,150,105,0.12); color: var(--success); border: 1px solid rgba(5,150,105,0.12); }
.badge.warn { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge.danger { background: rgba(239,68,68,0.08); color: var(--danger); }
.badge.gray { background: rgba(11,11,13,0.04); color: #0b1220; }

/* -------------------------
   9. Toast / notifications
   ------------------------- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 22px;
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(2,6,23,0.12);
  display: none;
  z-index: 9999;
  font-weight: 700;
  color: #fff;
}
.toast.success { background: linear-gradient(90deg, #16a34a, #059669); }
.toast.error { background: linear-gradient(90deg, #ef4444, #fb7185); }

/* -------------------------
   10. Utilities
   ------------------------- */
.hidden { display: none !important; }
.flex { display: flex; }
.center { display:flex; align-items:center; justify-content:center; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }
.p-1 { padding: 8px; }
.p-2 { padding: 14px; }

/* grid helpers */
.grid-3 { display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

/* helpers for icons/labels */
.icon { width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; }

/* -------------------------
   11. Responsive tweaks
   ------------------------- */
@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .navbar { padding: 12px 16px; }
  .site-title { font-size: 16px; }
  h1 { font-size: 20px; }
}
