@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0d0f14;
  --bg-secondary: #161a24;
  --bg-card: #1c2130;
  --bg-hover: #222840;
  --sidebar-w: 240px;
  --accent: #4f8ef7;
  --accent-dark: #3a72d8;
  --accent2: #00c896;
  --danger: #f05f5f;
  --warning: #f5a623;
  --success: #2ec76b;
  --text-primary: #e8eaf0;
  --text-secondary: #8994b0;
  --border: #252d42;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --transition: 0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  min-height: 100vh;
}

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

/* ─── LAYOUT ─────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 12px 20px 4px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.nav-item.active {
  background: rgba(79,142,247,0.12);
  color: var(--accent);
  border-left-color: var(--accent);
}
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 16px; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.user-info .user-name { font-size: 13px; font-weight: 600; }
.user-info .user-role {
  font-size: 11px; color: var(--text-secondary);
  text-transform: capitalize;
}
.sidebar-logout {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: rgba(240,95,95,0.1);
  border: 1px solid rgba(240,95,95,0.25);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: background var(--transition);
}
.sidebar-logout:hover { background: rgba(240,95,95,0.2); text-decoration: none; }

/* ─── MAIN CONTENT ────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── TOP BAR ─────────────────────────────────────────── */
.topbar {
  height: 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.notif-btn {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.notif-btn:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ─── PAGE BODY ───────────────────────────────────────── */
.page-body {
  padding: 28px;
  flex: 1;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header .subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ─── CARDS ───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(79,142,247,0.15); }
.stat-icon.green  { background: rgba(0,200,150,0.15); }
.stat-icon.orange { background: rgba(245,166,35,0.15); }
.stat-icon.red    { background: rgba(240,95,95,0.15); }
.stat-icon.purple { background: rgba(160,100,240,0.15); }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ─── TABLE ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(37,45,66,0.6);
  vertical-align: middle;
  font-size: 13.5px;
}
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: none; }

/* ─── BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-new       { background: rgba(160,100,240,0.15); color: #c07ef7; }
.badge-assigned  { background: rgba(79,142,247,0.15);  color: #4f8ef7; }
.badge-wo_created { background: rgba(245,166,35,0.15); color: #f5a623; }
.badge-surveyor_appointed { background: rgba(0,195,240,0.15); color: #00c3f0; }
.badge-vcvr_drafted { background: rgba(245,100,35,0.15); color: #f5642d; }
.badge-vcvr_review { background: rgba(245,166,35,0.2); color: #f7c25e; }
.badge-vcvr_final { background: rgba(0,200,150,0.15); color: var(--accent2); }
.badge-wo_closed { background: rgba(46,199,107,0.15); color: var(--success); }
.badge-draft     { background: rgba(137,148,176,0.15); color: var(--text-secondary); }
.badge-under_review { background: rgba(245,166,35,0.15); color: #f5a623; }
.badge-revision  { background: rgba(240,95,95,0.15); color: var(--danger); }
.badge-final     { background: rgba(0,200,150,0.15); color: var(--accent2); }
.badge-open      { background: rgba(79,142,247,0.15); color: var(--accent); }
.badge-sent      { background: rgba(245,166,35,0.15); color: #f5a623; }
.badge-paid      { background: rgba(46,199,107,0.15); color: var(--success); }
.badge-cancelled { background: rgba(240,95,95,0.15); color: var(--danger); }
.badge-success   { background: rgba(46,199,107,0.15); color: var(--success); }
.badge-inactive  { background: rgba(137,148,176,0.15); color: var(--text-secondary); }

/* ─── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { filter: brightness(0.9); text-decoration: none; color: #fff; }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { filter: brightness(0.9); text-decoration: none; color: #fff; }
.btn-warning {
  background: var(--warning);
  color: #fff;
}
.btn-warning:hover { filter: brightness(0.9); text-decoration: none; color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

/* ─── FORMS ───────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
input[type=text], input[type=email], input[type=password],
input[type=date], input[type=time], input[type=number],
input[type=tel], select, textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.1);
}
select option { background: var(--bg-card); }
textarea { resize: vertical; min-height: 80px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  grid-column: 1 / -1;
}

/* ─── ALERTS ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error   { background: rgba(240,95,95,0.1);   border: 1px solid rgba(240,95,95,0.25);   color: #f8a0a0; }
.alert-success { background: rgba(46,199,107,0.1);  border: 1px solid rgba(46,199,107,0.25);  color: #7ee5a2; }
.alert-info    { background: rgba(79,142,247,0.1);  border: 1px solid rgba(79,142,247,0.25);  color: #9cc4f9; }
.alert-warning { background: rgba(245,166,35,0.1);  border: 1px solid rgba(245,166,35,0.25);  color: #f9ce7a; }

/* ─── EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ─── TIMELINE ────────────────────────────────────────── */
.timeline { list-style: none; position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute;
  left: -20px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}
.timeline-content { font-size: 13px; }
.timeline-time { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ─── PHOTO GRID ──────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.photo-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-primary);
}
.photo-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.photo-label {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

/* ─── LOGIN PAGE ──────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 20% 30%, rgba(79,142,247,0.07) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 70%, rgba(0,200,150,0.06) 0%, transparent 60%);
}
.login-box {
  width: 100%;
  max-width: 400px;
  padding: 48px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .brand {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo .tagline { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.login-box h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.login-box .sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }
.btn-login {
  width: 100%;
  padding: 11px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity var(--transition);
  margin-top: 4px;
}
.btn-login:hover { opacity: 0.9; }

/* ─── PAGINATION ──────────────────────────────────────── */
.pagination { display: flex; gap: 6px; margin-top: 20px; align-items: center; }
.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: background var(--transition);
}
.pagination a:hover { background: var(--bg-hover); text-decoration: none; color: var(--text-primary); }
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── PUBLIC VCVR PAGE ────────────────────────────────── */
.public-page {
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 40px 20px;
}
.public-card {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.public-header {
  background: linear-gradient(135deg, #1a2240, #0f1a35);
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
}

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── UTILITIES ───────────────────────────────────────── */
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-secondary); }
.font-bold { font-weight: 700; }
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
