/* =========================================================
   MITAL INFOSYS - shared theme
   Colours come from the logo: navy + orange
   ========================================================= */
:root {
  --navy-900: #15134a;
  --navy-800: #1f1d5c;
  --navy-700: #2b2a75;
  --navy-100: #e8e8f6;
  --orange-500: #e8913a;
  --orange-600: #d27a22;
  --orange-100: #fdf0e3;

  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e5e7ef;
  --text: #1b1d2e;
  --text-2: #5b6075;
  --text-3: #8a8fa3;

  --green: #16a34a;  --green-bg: #e7f6ec;
  --amber: #b45309;  --amber-bg: #fdf3e1;
  --blue: #2563eb;   --blue-bg: #e8effd;
  --violet: #7c3aed; --violet-bg: #f1eafd;
  --red: #dc2626;    --red-bg: #fdecec;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 60, .05), 0 4px 16px rgba(20, 20, 60, .06);
  --shadow-lg: 0 20px 50px rgba(20, 20, 60, .18);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px; line-height: 1.5;
  color: var(--text); background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  color: #d9daf0; display: flex; flex-direction: column; padding: 18px 14px;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 46px; height: 46px; border-radius: 12px; background: #fff; display: grid; place-items: center; padding: 4px; flex: none; }
.brand strong { display: block; color: #fff; font-size: 15px; letter-spacing: .3px; }
.brand small { color: var(--orange-500); font-size: 12px; font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 0; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; font-weight: 500; color: #c9cae6; transition: background .15s, color .15s; }
.nav a i { width: 18px; text-align: center; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(232,145,58,.16); color: #fff; box-shadow: inset 3px 0 0 var(--orange-500); }
.nav a.active i { color: var(--orange-500); opacity: 1; }

.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 6px 2px; border-top: 1px solid rgba(255,255,255,.08); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.me small { font-size: 12px; color: #a3a5c9; }
.logout { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #c9cae6; }
.logout:hover { background: rgba(220,38,38,.18); color: #fff; }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--orange-500); color: #fff; font-weight: 600; font-size: 12.5px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; background: var(--navy-100); color: var(--navy-700); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: rgba(244,245,250,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.topbar p { color: var(--text-2); font-size: 13px; }
.topbar .title { flex: 1; min-width: 0; }
.topbar .date { display: inline-flex; gap: 8px; align-items: center; color: var(--text-2); font-size: 13px; background: var(--surface); border: 1px solid var(--border); padding: 7px 12px; border-radius: 999px; }
.topbar .menu-btn { display: none; }
.content { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.foot { padding: 18px 28px; color: var(--text-3); font-size: 12px; text-align: center; }
.scrim { display: none; }

/* ---------- Cards & stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-head h2 .count { background: var(--navy-100); color: var(--navy-700); font-size: 12px; padding: 2px 9px; border-radius: 999px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: none; }
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--text-2); font-size: 13px; }
.ic-navy { background: var(--navy-100); color: var(--navy-700); }
.ic-orange { background: var(--orange-100); color: var(--orange-600); }
.ic-blue { background: var(--blue-bg); color: var(--blue); }
.ic-violet { background: var(--violet-bg); color: var(--violet); }
.ic-green { background: var(--green-bg); color: var(--green); }

/* ---------- Toolbar (search + filters) ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; }
.search input { padding: 9px 12px 9px 34px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); width: 240px; }
.search input:focus { outline: none; border-color: var(--navy-700); background: #fff; box-shadow: 0 0 0 3px rgba(43,42,117,.12); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { border: 1px solid var(--border); background: var(--surface); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.filter.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* ---------- Table (turns into cards on phone) ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.list td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.list tbody tr { transition: background .12s; }
.list tbody tr:hover { background: #fafbff; }
.list tbody tr:last-child td { border-bottom: none; }
.id { font-weight: 600; color: var(--navy-700); font-variant-numeric: tabular-nums; }
.party strong { display: block; font-weight: 600; }
.party a { color: var(--text-2); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.party a:hover { color: var(--navy-700); }
.work-name { max-width: 320px; min-width: 190px; }
.list td[data-col="date"] { white-space: nowrap; }
.list td[data-col="date"] .muted { display: block; }
.muted { color: var(--text-3); font-size: 12.5px; }
.person { display: flex; align-items: center; gap: 8px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--amber-bg); color: var(--amber); }
.badge-approval { background: var(--violet-bg); color: var(--violet); }
.badge-assigned { background: var(--blue-bg); color: var(--blue); }
.badge-progress { background: var(--navy-100); color: var(--navy-700); }
.badge-done { background: var(--green-bg); color: var(--green); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.chip i { color: var(--orange-600); font-size: 11px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange-500); color: #fff; box-shadow: 0 4px 12px rgba(232,145,58,.3); }
.btn-primary:hover { background: var(--orange-600); }
.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #128a3e; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px 16px; font-size: 15px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; }
.btn-wa { background: #25d366; color: #fff; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--red); }
.input { position: relative; }
.input i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 14px; pointer-events: none; }
.input input, .input select, .field textarea, .field select, .field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.input input, .input select { padding-left: 38px; }
.field textarea { min-height: 96px; resize: vertical; }
.input input:focus, .input select:focus, .field textarea:focus, .field select:focus, .field input:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(43,42,117,.12); }
.toggle-pass { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 6px; pointer-events: auto; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; }
.alert i { margin-top: 3px; }
.alert-success { background: var(--green-bg); color: #14532d; border-color: #bfe5cb; }
.alert-error { background: var(--red-bg); color: #7f1d1d; border-color: #f5c2c2; }
.alert-info { background: var(--blue-bg); color: #1e3a8a; border-color: #c8d8fb; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty .ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--green-bg); color: var(--green); font-size: 26px; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 4px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(15,15,45,.5); backdrop-filter: blur(3px); }
.modal.open { display: flex; animation: fade .15s ease; }
.modal-box { width: 100%; max-width: 460px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s ease; overflow: hidden; }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; display: flex; gap: 10px; align-items: center; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); border-top: 1px solid var(--border); }
.summary { display: flex; gap: 10px; align-items: center; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; }
.note-wa { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #166534; background: #ecfbf1; border-radius: 10px; padding: 10px 12px; }
.note-wa i { color: #25d366; font-size: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* =========================================================
   Login / customer ticket page
   ========================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 48px;
  background: radial-gradient(1200px 600px at -10% -10%, rgba(232,145,58,.35), transparent 60%),
              linear-gradient(160deg, var(--navy-700), var(--navy-900));
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(232,145,58,.18); }
.hero-logo { background: #fff; border-radius: 18px; padding: 14px 18px; width: 220px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.auth-hero h1 { font-size: 36px; line-height: 1.15; letter-spacing: -.6px; margin: 36px 0 12px; max-width: 460px; }
.auth-hero h1 span { color: var(--orange-500); }
.auth-hero p.lead { color: #c9cae6; font-size: 16px; max-width: 440px; }
.services { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; max-width: 480px; }
.services span { display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.services i { color: var(--orange-500); }
.contact { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #d9daf0; position: relative; z-index: 1; }
.contact a { display: inline-flex; gap: 10px; align-items: center; }
.contact i { width: 18px; color: var(--orange-500); }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .mobile-logo { display: none; }
.auth-card h2 { font-size: 24px; letter-spacing: -.3px; }
.auth-card .sub { color: var(--text-2); margin: 4px 0 20px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: #e9eaf3; border-radius: 12px; margin-bottom: 20px; }
.tabs button { border: 0; background: none; padding: 10px 8px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--text-2); cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center; }
.tabs button.active { background: #fff; color: var(--navy-800); box-shadow: 0 1px 3px rgba(20,20,60,.12); }
.pane { display: none; }
.pane.active { display: block; animation: fade .2s ease; }
.ticket-ok { text-align: center; padding: 8px 0 4px; }
.ticket-ok .big { font-size: 34px; font-weight: 700; color: var(--navy-800); letter-spacing: 1px; }
.small-print { text-align: center; color: var(--text-3); font-size: 12.5px; margin-top: 18px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card .mobile-logo { display: block; width: 170px; margin: 0 auto 18px; }
  .auth-card h2, .auth-card .sub { text-align: center; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(15,15,45,.45); z-index: 30; }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 17px; }
  .topbar .date { display: none; }
  .content { padding: 16px 16px 32px; gap: 16px; }
  .search input { width: 100%; }
  .search { flex: 1; min-width: 180px; }

  /* table rows become cards */
  .list thead { display: none; }
  .list, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list tr { padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
  .list td { padding: 0; border: 0; }
  .list td[data-col="id"] { grid-column: 1; }
  .list td[data-col="status"] { grid-column: 2; grid-row: 1; justify-self: end; }
  .list td[data-col="party"], .list td[data-col="work"] { grid-column: 1 / -1; }
  .list td[data-col="type"], .list td[data-col="staff"], .list td[data-col="date"] { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
  .list td[data-col="action"] { grid-column: 1 / -1; margin-top: 6px; }
  .list td[data-col="action"] .row-actions { justify-content: stretch; }
  .list td[data-col="action"] .btn { flex: 1; padding: 10px; }
  .work-name { max-width: none; min-width: 0; }
  .list td[data-col="date"] .muted { display: inline; }
}
@media (max-width: 520px) {
  .stats { gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat .ic { width: 38px; height: 38px; font-size: 15px; }
  .stat .num { font-size: 21px; }
  .tabs button span { display: none; }
  .tabs button i { font-size: 16px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: 18px 18px 0 0; max-width: none; }
}
