/* ═══════════════════════════════════════════════════════════════
   WDID Client Portal — Shared Styles
   Shelbourne Hotel Sydney
   ═══════════════════════════════════════════════════════════════ */

/* ═══════ VARIABLES ═══════ */
:root {
  --red: #eb1c23;
  --red-dark: #c41019;
  --red-light: #fef0f0;
  --red-lighter: #fff5f5;
  --amber: #e67e22;
  --amber-light: #fef5ec;
  --green: #27ae60;
  --green-light: #eafaf1;
  --blue: #2980b9;
  --blue-light: #e8f4fd;
  --purple: #8e44ad;
  --purple-light: #f3e8fd;
  --charcoal: #1e1e1e;
  --dark: #2d2d2d;
  --text: #333333;
  --text-light: #666666;
  --text-lighter: #999999;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --bg: #f7f7f8;
  --bg-subtle: #fafafa;
  --white: #ffffff;
  --sidebar-w: 260px;
  --header-h: 60px;
  --radius: 0.6rem;
  --radius-lg: 0.85rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
}

/* ═══════ RESET ═══════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-dark); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ═══════ LAYOUT SHELL ═══════ */
.portal-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ═══════ SIDEBAR ═══════ */
.sidebar {
  background: var(--charcoal);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 200;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-header img { width: 38px; height: 38px; border-radius: 50%; }
.sidebar-header .brand { font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; }
.sidebar-header .brand span { color: var(--red); }

.sidebar-client {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.sidebar-nav a:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.04);
}
.sidebar-nav a.active {
  color: var(--white);
  background: rgba(235,28,35,0.12);
  border-left-color: var(--red);
}
.sidebar-nav a .icon { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.2);
}

/* Mobile toggle */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 300;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--charcoal);
  color: #fff;
  border-radius: 0.4rem;
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

/* ═══════ MAIN CONTENT ═══════ */
.main-content {
  grid-column: 2;
  padding: 2rem 2.5rem 3rem;
  max-width: 1200px;
  width: 100%;
}

/* ═══════ PAGE HEADER ═══════ */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-header .breadcrumb {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-lighter);
  margin-bottom: 0.5rem;
}
.page-header .breadcrumb a { color: var(--text-lighter); }
.page-header .breadcrumb a:hover { color: var(--red); }
.page-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.9rem;
  color: var(--charcoal);
  line-height: 1.25;
}
.page-header h1 span { color: var(--red); }
.page-header .subtitle {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-top: 0.4rem;
  max-width: 650px;
}

/* ═══════ CARDS ═══════ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.card-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--charcoal);
}
.card-header h2 span { color: var(--red); }

/* ═══════ STAT CARDS ═══════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-lighter);
  margin-top: 0.3rem;
}
.stat-red .stat-value { color: var(--red); }
.stat-amber .stat-value { color: var(--amber); }
.stat-green .stat-value { color: var(--green); }
.stat-blue .stat-value { color: var(--blue); }

/* ═══════ TABLES ═══════ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
thead th {
  background: var(--charcoal);
  color: var(--white);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  white-space: nowrap;
}
tbody td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tbody tr:hover td { background: var(--bg-subtle); }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem; }

/* ═══════ BADGES ═══════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 0.25rem;
  white-space: nowrap;
}
.badge-red { background: var(--red-light); color: var(--red); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-dark { background: var(--charcoal); color: var(--white); }
.badge-grey { background: #f0f0f0; color: var(--text-lighter); }

/* ═══════ STATUS ICONS ═══════ */
.status-yes { color: var(--green); font-weight: 700; }
.status-no { color: var(--red); font-weight: 700; }
.status-partial { color: var(--amber); font-weight: 700; }

/* ═══════ SCORE BARS ═══════ */
.score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.score-label {
  width: 140px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}
.score-bar-outer {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.score-num {
  width: 40px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ═══════ TIMELINE / TASK ITEMS ═══════ */
.task-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: transparent;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.task-check.done { border-color: var(--green); background: var(--green-light); color: var(--green); }
.task-check.in-progress { border-color: var(--amber); background: var(--amber-light); color: var(--amber); }
.task-check.blocked { border-color: var(--red); background: var(--red-light); color: var(--red); }
.task-body h4 { font-size: 0.88rem; color: var(--charcoal); margin-bottom: 0.15rem; }
.task-body p { font-size: 0.78rem; color: var(--text-light); }
.task-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}
.task-date { font-size: 0.7rem; color: var(--text-lighter); white-space: nowrap; }

/* ═══════ EVIDENCE CARDS ═══════ */
.evidence-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.evidence-card .evidence-img {
  width: 100%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-lighter);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
}
.evidence-card .evidence-img img { width: 100%; height: auto; display: block; }
.evidence-card .evidence-body { padding: 1rem 1.25rem; }
.evidence-card .evidence-body h4 { font-size: 0.88rem; margin-bottom: 0.25rem; }
.evidence-card .evidence-body p { font-size: 0.78rem; color: var(--text-light); }

/* ═══════ SERVICE CARDS ═══════ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.service-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--red);
  transform: translateY(-2px);
}
.service-card .service-icon { font-size: 2.4rem; margin-bottom: 0.75rem; }
.service-card h3 { font-size: 0.95rem; color: var(--charcoal); margin-bottom: 0.4rem; }
.service-card p { font-size: 0.78rem; color: var(--text-light); line-height: 1.55; }

/* ═══════ CONTACT CARD ═══════ */
.contact-card {
  background: var(--charcoal);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}
.contact-card img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--red); }
.contact-card .info h3 { font-size: 1.3rem; font-family: 'Cinzel', serif; margin-bottom: 0.1rem; }
.contact-card .info .role { color: rgba(255,255,255,0.5); font-size: 0.8rem; margin-bottom: 0.5rem; }
.contact-card .info a { color: var(--red); font-size: 0.88rem; display: block; margin-top: 0.2rem; }

/* ═══════ FILTER BAR ═══════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  background: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* ═══════ EMPTY STATE ═══════ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-lighter);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--text-light); margin-bottom: 0.3rem; }
.empty-state p { font-size: 0.82rem; }

/* ═══════ IMAGE UPLOAD PLACEHOLDERS ═══════ */
.screenshot-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-lighter);
  font-size: 0.8rem;
  gap: 0.3rem;
  background: var(--bg-subtle);
  margin-bottom: 0.75rem;
}
.screenshot-placeholder .ph-icon { font-size: 1.5rem; opacity: 0.4; }

/* ═══════ PASSWORD FIELD ═══════ */
.pw-mask {
  font-family: monospace;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--text-lighter);
}

/* ═══════ NOTES BOX ═══════ */
.notes-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 1rem;
  line-height: 1.6;
}
.notes-box strong { color: var(--text); }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 900px) {
  .portal-layout { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: flex; }
  .mobile-overlay.active { display: block; }
  .main-content { grid-column: 1; padding: 1.25rem; padding-top: 3.5rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .contact-card { flex-direction: column; text-align: center; }
}

@media print {
  .sidebar, .mobile-toggle, .mobile-overlay { display: none !important; }
  .portal-layout { grid-template-columns: 1fr; }
  .main-content { padding: 1rem; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ═══════ PASSWORD GATE ═══════ */
body.portal-locked .portal-layout,
body.portal-locked .mobile-toggle,
body.portal-locked .mobile-overlay { display: none !important; }

.login-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--charcoal);
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
}
body.portal-locked .login-gate { display: flex; align-items: center; justify-content: center; }

.login-box {
  background: var(--white);
  border-radius: 12px;
  padding: 2.5rem 2rem 2rem;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-box img { width: 52px; height: 52px; border-radius: 50%; margin-bottom: 0.75rem; }

.login-box .login-brand {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--charcoal);
  margin-bottom: 0.25rem;
}
.login-box .login-brand span { color: var(--red); }

.login-box .login-client {
  font-size: 0.78rem;
  color: var(--text-lighter);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.login-box label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  text-align: left;
  margin-bottom: 0.35rem;
}

.login-box input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.login-box input[type="password"]:focus { border-color: var(--red); }
.login-box input[type="password"].shake {
  animation: loginShake 0.4s ease;
  border-color: var(--red);
}

.login-box button {
  width: 100%;
  padding: 0.7rem;
  margin-top: 1rem;
  background: var(--charcoal);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.login-box button:hover { background: var(--red); }

.login-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.login-footer {
  font-size: 0.7rem;
  color: var(--text-lighter);
  margin-top: 1.5rem;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
