/* styles.css
   Modern, responsive, accessible UI for the ITSM example pages
   - CSS variables for theming
   - Lightweight reset + sensible defaults
   - Layout helpers, form controls, tables, buttons, cards, and nav
*/

/* ========== Theme variables ========== */
:root{
  --bg: #F2FCFF;
  --card: #ffffff;
  --muted: #64748b;
  --text: #0b1220;
  --accent: #3b82f6;
  --accent-2: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;
  --glass: rgba(11,18,32,0.03);
  --border: rgba(11,18,32,0.06);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Segoe UI Mono", monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --shadow-1: 0 6px 18px rgba(2,6,23,0.06);
  --max-width: 1100px;
  --gap: 16px;
  --ui-padding: 18px;
}

/* ========== Reset / Base ========== */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), #eaf9ff);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 24px;
}

/* ========== Container / Layout ========== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 18px;
}

/* Simple page header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  margin-bottom: 20px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}
.brand .logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 8px;
  display: inline-block;
  box-shadow: var(--shadow-1);
}
.brand h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}

/* Top actions */
.top-actions a, .top-actions button {
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.top-actions a.primary, .top-actions button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  box-shadow: 0 6px 16px rgba(59,130,246,0.12);
}

/* Page grid */
.grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

/* For narrow screens stack */
@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
}

/* ========== Card ========== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--ui-padding);
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(11,18,32,0.03);
  color: var(--text);
}

/* Sidebar */
.sidebar .card { padding: 12px; }
.menu { display: flex; flex-direction: column; gap: 6px; }
.menu a {
  padding: 8px 10px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  display: block;
  font-size: 14px;
}
.menu a.active, .menu a:hover {
  color: var(--text);
  background: var(--glass);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

/* ========== Forms ========== */
form { display: block; gap: 12px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
label { font-size: 14px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: box-shadow .12s, border-color .12s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  box-shadow: 0 6px 16px rgba(11,20,32,0.06);
  border-color: rgba(59,130,246,0.35);
}

/* Inline help / flash */
.flash {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.14);
  color: var(--success);
  font-weight: 600;
}
.flash.error {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.12);
  color: var(--danger);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  box-shadow: 0 8px 24px rgba(11,92,255,0.08);
}

/* small ghost */
.btn.ghost {
  background: transparent;
  border: 1px dashed rgba(11,18,32,0.04);
  color: var(--muted);
}

/* ========== Tickets list and cards ========== */
.tickets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.tickets-count {
  color: var(--muted);
  font-size: 14px;
}

/* responsive cards grid */
.tickets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* fallback empty state card */
.empty-card .muted {
  margin: 0;
  font-size: 14px;
}

/* Ticket card for compact view */
.ticket-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  transition: transform .12s, box-shadow .12s;
}
.ticket-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(11,18,32,0.06);
}

/* main content inside ticket */
.ticket-main { flex: 1; }

/* title and meta */
.ticket-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.ticket-sub {
  font-size: 13px;
  color: var(--muted);
}

/* right column meta */
.ticket-meta {
  text-align: right;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* description with truncation */
.ticket-desc {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* actions and footer inside card */
.ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
}

/* small utilities */
.row { display: flex; gap: 12px; align-items: center; }
.col { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.p-xs { padding: 8px; }
.text-right { text-align: right; }
.small { font-size: 13px; color: var(--muted); }
.separator { height: 1px; background: var(--border); margin: 12px 0; border-radius: 2px; }

/* ========== Badge styles ========== */
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.badge.low { background: #94a3b8; }
.badge.medium { background: var(--accent); }
.badge.high { background: var(--danger); }

/* actions column */
.actions a, .actions button { text-decoration: none; color: var(--accent); font-weight: 600; }

/* ========== Accessibility helpers ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ========== Footer ========== */
.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ========== Responsiveness tweaks ========== */
@media (max-width: 640px) {
  .brand h1 { font-size: 16px; }
  .top-actions a { padding: 8px; }
  .card { padding: 12px; }
  .ticket-card { flex-direction: column; align-items: stretch; }
  .ticket-meta { align-items: flex-start; text-align: left; min-width: auto; }
  .tickets-grid { grid-template-columns: 1fr; }
}
