/*
  Minimal, mobile-first CSS for SOC ITSM static pages
  - System font stack, accessible colors, and responsive layout
  - Utility-ish classes kept small and readable
*/

:root {
  --bg: #f7f9fc;
  --panel: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --text-white: #fff;
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --border: #e2e8f0;
  --ring: rgba(37, 99, 235, 0.25);
  --radius: 12px;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 800px at 80% -10%, #eaf1ff 0%, var(--bg) 60%);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; }

img { max-width: 100%; height: auto; }

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

/* Header and Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.brand .logo {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
  color: white;
  font-weight: 800;
}
.nav-links {
  display: none;
  gap: 18px;
  align-items: center;
}
.nav-actions { display: none; gap: 10px; }
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

@media (min-width: 768px) {
  .nav-links { display: inline-flex; }
  .nav-actions { display: inline-flex; }
  .nav-toggle { display: none; }
}

.mobile-menu {
  display: none;
  padding: 10px 0 18px;
}
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 8px 0; }

/* Panels and Sections */
.panel {
  background: linear-gradient(180deg, #ffffff, #ffffff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.page {
  padding: 24px 0 48px;
}

/* Forms */
.form {
  display: grid;
  gap: 14px;
}
.form-row { display: grid; gap: 8px; }
.label { font-size: 13px; color: var(--muted); }
.input, .select {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.input:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}
.hint { font-size: 12px; color: var(--muted); }
.form-row.inline {
  display: flex; align-items: center; gap: 10px;
}
.checkbox { width: 16px; height: 16px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #ffffff;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn:focus { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn-primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-600));
  border-color: transparent;
  color: var(--text-white);
}
.btn-ghost { background: transparent; }

/* Grid and cards */
.grid {
  display: grid;
  gap: 16px;
}
.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card {
  padding: 16px;
}
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat .value {
  font-size: 28px;
  font-weight: 700;
}
.stat .label { color: var(--muted); font-size: 13px; }

/* Footer */
.footer { color: var(--muted); font-size: 13px; padding: 18px 0 28px; }

/* Utility */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--muted); }
.hidden { display: none; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 10px;
  vertical-align: top;
}
.table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.table tbody tr + tr {
  border-top: 1px solid var(--border);
}

/* Responsive table (stack at small screens) */
@media (max-width: 640px) {
  .table thead { display: none; }
  .table tbody tr { display: block; padding: 10px 0; }
  .table tbody tr + tr { border-top: 1px solid var(--border); }
  .table td { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 8px 4px; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
}

/* Progress bar for SLA */
.progress {
  width: 140px;
  height: 8px;
  border-radius: 9999px;
  background: #eef2f7;
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-600));
}
.progress.warn > span { background: linear-gradient(180deg, var(--warning), #b45309); }
.progress.bad > span { background: linear-gradient(180deg, var(--danger), #b91c1c); }

/* Tabs */
.tabs {
  display: grid;
  gap: 12px;
}
.tablist {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tablist .tab {
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  background: linear-gradient(180deg, #f1f5ff, #ffffff);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.tabpanel { display: none; }
.tabpanel.active { display: block; }

/* Badges / status */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 9999px;
  background: #eef2f7;
  border: 1px solid var(--border);
}
.badge.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.badge.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.badge.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Comments */
.comments { display: grid; gap: 12px; }
.comment {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.comment .meta { color: var(--muted); font-size: 12px; }

/* Attachment area */
.dropzone {
  display: grid;
  place-items: center;
  min-height: 110px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fafcff;
  color: var(--muted);
}
.file-list { list-style: none; padding: 0; margin: 8px 0 0; }
.file-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }

/* === Enterprise UI Additions (Sidebar/Topbar, Tiles, Toolbar, Pills) === */
:root {
  --accent: #ffde17;
  --accent-700: #f5c400;
  --text-white: #fff;
}

.layout { min-height: 100vh; display: grid; grid-template-columns: 68px 1fr; background: #f5f7fb; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--accent);
  border-right: 1px solid #e9d700; display: flex; flex-direction: column; align-items: center; padding: 10px 8px;
}
.sidebar .logo { width: 42px; height: 42px; border-radius: 10px; background: #fff; color: #111; display: grid; place-items: center; font-weight: 800; margin: 6px 0 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.06); }
.sidebar .nav { display: grid; gap: 8px; width: 100%; margin-top: 8px; }
.sidebar .nav a { color: #222; text-decoration: none; font-size: 12px; display: grid; place-items: center; padding: 10px 6px; border-radius: 10px; }
.sidebar .nav a:hover { background: rgba(255,255,255,0.6); }

.content { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.top-title { font-weight: 700; letter-spacing: 0.2px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.avatar { width: 28px; height: 28px; border-radius: 9999px; background: #cbd5e1; display: inline-block; }
.workspace { padding: 16px; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.tile .label { color: #334155; font-weight: 600; }
.tile .value { font-size: 26px; font-weight: 800; margin-top: 4px; }

.toolbar { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.control { display: inline-flex; align-items: center; gap: 6px; }
.control select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }

.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 9999px; border: 1px solid var(--border); background: #f1f5f9; font-size: 12px; }
.status-pill.pending { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.status-pill.progress { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; }
.status-pill.resolved { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.status-pill.closed { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.dot { width: 10px; height: 10px; border-radius: 9999px; display: inline-block; }
.dot.green { background: #10b981; }
.dot.orange { background: #f59e0b; }
.dot.red { background: #ef4444; }
.dot.gray { background: #94a3b8; }

.table thead th { background: #fafafa; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 56px 1fr; }
  .workspace { padding: 12px; }
}

/* Auth pages */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card { width: 100%; max-width: 520px; }
.logo-badge { width: 48px; height: 48px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--accent); color: #111; font-weight: 800; }
