/* ============================================================
   IT Works Ltd — design system
   Brand: red #D2232A, slate #8E9DA6, ink #16202A
   ============================================================ */

:root {
  --red: #d2232a;
  --red-dark: #a91b21;
  --red-soft: #fdeaeb;
  --slate: #8e9da6;
  --slate-dark: #5f6e78;
  --ink: #16202a;
  --navy: #0f1820;
  --navy-2: #1a2735;
  --text: #2c3640;
  --muted: #6b7884;
  --bg: #f4f6f8;
  --card: #ffffff;
  --border: #e2e8ec;
  --green: #1d9e55;
  --amber: #c77d0a;
  --blue: #2563ad;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 32, 42, .05), 0 4px 14px rgba(22, 32, 42, .06);
  --shadow-lg: 0 4px 10px rgba(22, 32, 42, .08), 0 14px 40px rgba(22, 32, 42, .12);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 15.5px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 2.1rem; } h2 { font-size: 1.55rem; } h3 { font-size: 1.18rem; } h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: 9px; border: 1px solid transparent; font-weight: 600; font-size: .92rem;
  cursor: pointer; text-decoration: none !important; transition: all .15s; line-height: 1.3;
  font-family: var(--font);
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-outline { background: transparent; color: var(--ink); border-color: #c6cfd6; }
.btn-outline:hover { border-color: var(--ink); background: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-light:hover { border-color: var(--slate); }
.btn-ghost-light { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,.16); }
.btn-sm { padding: 6px 12px; font-size: .82rem; border-radius: 7px; }
.btn-danger { background: #fff; color: var(--red); border-color: #f0c4c6; }
.btn-danger:hover { background: var(--red-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- public header ---------------- */
.site-header {
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.site-header .container { display: flex; align-items: center; gap: 26px; height: 72px; }
.site-header .logo img { height: 40px; display: block; }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav a {
  color: var(--text); font-weight: 600; font-size: .92rem; padding: 9px 13px;
  border-radius: 8px; text-decoration: none !important;
}
.site-nav a:hover, .site-nav a.active { color: var(--red); background: var(--red-soft); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 12px 18px 18px;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
  }
  .site-nav.open { display: flex; }
}

/* ---------------- hero ---------------- */
.hero {
  background:
    radial-gradient(800px 420px at 85% -10%, rgba(210, 35, 42, .28), transparent 60%),
    radial-gradient(620px 380px at -5% 110%, rgba(142, 157, 166, .18), transparent 55%),
    var(--navy);
  color: #d8dee3; padding: 84px 0 88px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(700px 460px at 70% 30%, #000 0%, transparent 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: 2.7rem; max-width: 640px; margin-bottom: 18px; }
.hero p.lead { font-size: 1.13rem; max-width: 560px; color: #aeb9c2; }
.hero .eyebrow {
  display: inline-block; font-size: .78rem; letter-spacing: 2.5px; font-weight: 700;
  text-transform: uppercase; color: #e98a8e; margin-bottom: 14px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-badges { display: flex; gap: 26px; margin-top: 44px; flex-wrap: wrap; }
.hero-badges div strong { display: block; color: #fff; font-size: 1.35rem; }
.hero-badges div span { font-size: .85rem; color: #8e9da6; }
@media (max-width: 640px) { .hero { padding: 56px 0; } .hero h1 { font-size: 2rem; } }

/* ---------------- sections ---------------- */
.section { padding: 72px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 660px; margin-bottom: 40px; }
.section-head .eyebrow {
  color: var(--red); font-size: .78rem; letter-spacing: 2.5px; font-weight: 700;
  text-transform: uppercase; display: block; margin-bottom: 10px;
}
.section.dark {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #c2ccd3;
}
.section.dark h2, .section.dark h3 { color: #fff; }

/* ---------------- cards ---------------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card.hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); transition: all .18s; }
.service-card { display: flex; flex-direction: column; gap: 10px; }
.service-card .icon {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 11px;
  background: var(--red-soft); color: var(--red); flex: none;
}
.service-card .icon svg { width: 24px; height: 24px; }
.service-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .num { font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1; }
.kpi .lbl { color: var(--muted); font-size: .88rem; }
.kpi.alert .num { color: var(--red); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
  text-align: left; padding: 11px 14px; background: #f8fafb; color: var(--slate-dark);
  font-size: .76rem; text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid #eef2f4; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fafbfc; }
table.data a { font-weight: 600; }
.empty { padding: 38px; text-align: center; color: var(--muted); }

/* ---------------- badges ---------------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .74rem;
  font-weight: 700; letter-spacing: .3px; white-space: nowrap; line-height: 1.5;
  background: #eef1f3; color: var(--slate-dark);
}
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.green { background: #e3f5ea; color: var(--green); }
.badge.amber { background: #fcf2e2; color: var(--amber); }
.badge.blue { background: #e7eff8; color: var(--blue); }
.badge.dark { background: var(--ink); color: #fff; }
.badge.outline { background: transparent; border: 1px solid var(--border); }

/* ---------------- forms ---------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=number], input[type=file], input[type=month], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid #c9d2d9; border-radius: 9px;
  font-family: var(--font); font-size: .92rem; color: var(--text); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(210, 35, 42, .12);
}
textarea { min-height: 110px; resize: vertical; }
.checkbox { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.checkbox input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: .9rem; border: 1px solid; }
.alert.error { background: var(--red-soft); color: var(--red-dark); border-color: #f2c5c7; }
.alert.success { background: #e3f5ea; color: #14693a; border-color: #bfe6cd; }
.alert.info { background: #e7eff8; color: #1c4d80; border-color: #c5d9ec; }

/* ---------------- footer ---------------- */
.site-footer { background: var(--navy); color: #97a4ad; padding: 56px 0 28px; margin-top: 0; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.site-footer a { color: #b6c0c8; display: block; padding: 3px 0; font-size: .9rem; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 36px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.09); margin-top: 40px; padding-top: 22px; font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-logo { height: 44px; margin-bottom: 14px; filter: brightness(0) invert(1) opacity(.92); }

/* ---------------- app shell (portal/admin) ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--navy); color: #aab6bf; display: flex;
  flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img { height: 34px; filter: brightness(0) invert(1); }
.sidebar .brand .sub { font-size: .68rem; letter-spacing: 2px; color: var(--slate); text-transform: uppercase; margin-top: 6px; }
.sidebar nav { padding: 14px 12px; flex: 1; }
.sidebar nav .group { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.6px; color: #5f6e78; padding: 14px 10px 6px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: #aab6bf; font-size: .92rem; font-weight: 500; text-decoration: none !important; margin-bottom: 2px;
}
.sidebar nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--red); color: #fff; }
.sidebar .user-box { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.sidebar .user-box .name { color: #fff; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--border); padding: 14px 28px;
  display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap;
}
.topbar h1 { font-size: 1.25rem; margin: 0; }
.content { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }
.sidebar-toggle { display: none; }
@media (max-width: 880px) {
  .sidebar { position: fixed; left: -260px; transition: left .2s; z-index: 90; height: 100vh; }
  .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: inline-flex; }
  .content { padding: 18px 16px 50px; }
  .topbar { padding: 12px 16px; }
}

/* ---------------- misc components ---------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: flex-end; }
.filters .field { margin: 0; min-width: 140px; flex: 1; max-width: 220px; }
.filters .field.grow { max-width: none; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tabs a {
  padding: 9px 16px; font-weight: 600; font-size: .9rem; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none !important;
}
.tabs a.active { color: var(--red); border-bottom-color: var(--red); }
.tabs a:hover { color: var(--ink); }
.reply { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; background: #fff; overflow: hidden; }
.reply .reply-head { padding: 10px 16px; background: #f8fafb; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; flex-wrap: wrap; }
.reply .reply-body { padding: 14px 16px; white-space: pre-wrap; }
.reply.internal { border-color: #f0d9a8; }
.reply.internal .reply-head { background: #fdf6e7; }
.reply.staff .reply-head .who { color: var(--red); font-weight: 700; }
.timeline-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef2f4; font-size: .88rem; }
.timeline-item:last-child { border-bottom: 0; }
.detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: .9rem; }
.detail-list dt { color: var(--muted); font-weight: 500; }
.detail-list dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }
.testimonial { position: relative; padding-top: 30px; }
.testimonial::before { content: "\201C"; position: absolute; top: -6px; left: 18px; font-size: 4rem; color: var(--red); opacity: .25; font-family: Georgia, serif; }
.partner-pill { background: #fff; border: 1px solid var(--border); border-radius: 99px; padding: 10px 22px; font-weight: 600; color: var(--slate-dark); }
.attachment-chip {
  display: inline-flex; align-items: center; gap: 6px; background: #f1f4f6; padding: 5px 12px;
  border-radius: 8px; font-size: .82rem; margin: 3px 4px 3px 0; border: 1px solid var(--border);
}
.prose h2 { margin-top: 1.6em; } .prose h3 { margin-top: 1.3em; }
.prose ul { padding-left: 22px; }
.prose table { border-collapse: collapse; } .prose td, .prose th { border: 1px solid var(--border); padding: 6px 12px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px;
  background: radial-gradient(700px 400px at 80% 0%, rgba(210,35,42,.16), transparent 60%), var(--navy); }
.login-card { width: 100%; max-width: 410px; background: #fff; border-radius: 16px; padding: 34px; box-shadow: var(--shadow-lg); }
.login-card .logo { height: 46px; display: block; margin: 0 auto 6px; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: 7px 0 7px 30px; position: relative; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--red-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d2232a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 11px; background-position: center; background-repeat: no-repeat;
}
.pre-line { white-space: pre-line; }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }

/* ---------------- work logs / service reports ---------------- */
.big-action { font-size: 1.05rem; padding: 16px 26px; width: 100%; justify-content: center; }
.timer-live { font-size: 2rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sig-canvas { width: 100%; height: 160px; border: 2px dashed #c9d2d9; border-radius: 10px; background: #fff; touch-action: none; }
.report-sheet { max-width: 820px; margin: 24px auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 38px 44px; box-shadow: var(--shadow); }
.report-sheet .rs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid var(--red); padding-bottom: 18px; margin-bottom: 22px; }
.report-sheet .rs-head img { height: 48px; }
.report-sheet h1 { font-size: 1.4rem; margin: 0; }
.report-sheet table.rs { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 18px; }
.report-sheet table.rs td { padding: 7px 10px; border: 1px solid var(--border); vertical-align: top; }
.report-sheet table.rs td:first-child { width: 190px; background: #f8fafb; font-weight: 600; color: var(--slate-dark); }
.rs-section { margin: 14px 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--red); font-weight: 700; }
.rs-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.rs-sigbox { border: 1px solid var(--border); border-radius: 8px; min-height: 110px; padding: 10px; }
.rs-sigbox img { max-height: 90px; }
.rs-footer { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 14px; font-size: .8rem; color: var(--muted); text-align: center; }
@media print {
  body { background: #fff; }
  .no-print, .sidebar, .topbar { display: none !important; }
  .report-sheet { border: none; box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .content { padding: 0; }
}
@media (max-width: 640px) {
  .report-sheet { padding: 20px; }
  .rs-sigs { grid-template-columns: 1fr; }
}

/* ---------------- WhatsApp floating button ---------------- */
.wa-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  display: inline-flex; align-items: center; gap: 9px;
  background: #25d366; color: #fff !important; text-decoration: none !important;
  padding: 12px 18px 12px 14px; border-radius: 99px; font-weight: 700; font-size: .95rem;
  box-shadow: 0 6px 20px rgba(18, 140, 70, .45);
  transition: transform .15s, box-shadow .15s;
}
.wa-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(18, 140, 70, .55); background: #1fbd5a; }
.wa-fab svg { width: 26px; height: 26px; flex: none; }
@media (max-width: 640px) {
  .wa-fab { padding: 13px; right: 14px; bottom: 14px; }
  .wa-fab span { display: none; }  /* icon-only on phones */
}
