/* ═══════════════════════════════════════════════════════════════════
   PU Travel Desk v2.0 — Main Stylesheet
   Mobile-first design, navy + amber, DM Sans
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
  --navy:        #0f1f3d;
  --navy-light:  #1a3260;
  --navy-muted:  #2d4a7a;
  --amber:       #f59e0b;
  --amber-light: #fef3c7;
  --amber-dark:  #b45309;
  --bg:          #f8f7f4;
  --bg-card:     #ffffff;
  --bg-inset:    #f1f0ec;
  --border:      #e5e4df;
  --border-strong:#cccbc6;
  --text-primary:   #1a1a2e;
  --text-secondary: #5a5a6e;
  --text-muted:     #9090a0;
  --text-invert:    #ffffff;
  --green:       #16a34a;
  --green-bg:    #dcfce7;
  --red:         #dc2626;
  --red-bg:      #fee2e2;
  --blue:        #2563eb;
  --blue-bg:     #dbeafe;
  --orange:      #ea580c;
  --orange-bg:   #ffedd5;
  --sidebar-w:   240px;
  --sidebar-bg:  #0f1f3d;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active: rgba(245,158,11,0.15);
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.1);
  --transition: 0.18s ease;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Portal Layout ──────────────────────────────────────────────── */
.portal-layout {
  display: flex;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Mobile overlay behind sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo a {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.logo-mark {
  width: 34px; height: 34px;
  background: var(--amber); color: var(--navy);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; letter-spacing: 0.5px; flex-shrink: 0;
}
.logo-text { color: #fff; font-size: 15px; font-weight: 500; letter-spacing: -0.2px; }

.sidebar-nav {
  flex: 1; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.65);
  font-size: 14px; font-weight: 400;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  min-height: 44px; /* Touch target */
}
.nav-item svg { opacity: 0.7; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: var(--sidebar-active); color: var(--amber); font-weight: 500; }
.nav-item.active svg { opacity: 1; color: var(--amber); }

.sidebar-user {
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: var(--navy-muted);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar span { color: #fff; font-size: 14px; font-weight: 600; }
.user-info { flex: 1; overflow: hidden; }
.user-name {
  color: rgba(255,255,255,0.9); font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { color: rgba(255,255,255,0.4); font-size: 11px; margin-top: 1px; }
.logout-btn {
  color: rgba(255,255,255,0.35); padding: 8px; border-radius: var(--radius-sm);
  display: flex; transition: color var(--transition), background var(--transition);
  flex-shrink: 0; min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.logout-btn:hover { color: var(--red); background: rgba(220,38,38,0.1); text-decoration: none; }

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

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text-secondary); padding: 8px; border-radius: var(--radius-sm);
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.sidebar-toggle:hover { background: var(--bg-inset); color: var(--text-primary); }

.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 16px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.3px; }
.topbar-title p { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.portal-content { padding: 28px; flex: 1; }

/* ── Login Page ─────────────────────────────────────────────────── */
.putd-login-page { background: var(--bg); }
.login-split { display: flex; min-height: 100vh; }
.login-brand {
  width: 42%; background: var(--navy); padding: 60px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-brand::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.brand-content { position: relative; z-index: 1; }
.logo-mark-lg {
  width: 54px; height: 54px; background: var(--amber); color: var(--navy);
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; letter-spacing: 1px; margin-bottom: 28px;
}
.login-brand h1 { color: #fff; font-size: 36px; font-weight: 600; letter-spacing: -1px; line-height: 1.15; margin-bottom: 16px; }
.login-brand p { color: rgba(255,255,255,0.55); font-size: 15px; line-height: 1.7; margin-bottom: 32px; }
.brand-features { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.brand-features li { color: rgba(255,255,255,0.7); font-size: 14px; padding-left: 20px; position: relative; }
.brand-features li::before { content: ''; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; background: var(--amber); border-radius: 50%; }
.brand-footer p { color: rgba(255,255,255,0.3); font-size: 12px; }

.login-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.login-card { width: 100%; max-width: 440px; }
.login-card h2 { font-size: 26px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.5px; margin-bottom: 28px; }
.login-section { margin-bottom: 24px; }
.login-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 10px; }
.login-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.login-divider { text-align: center; position: relative; margin: 20px 0; }
.login-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.login-divider span { position: relative; background: var(--bg); padding: 0 14px; font-size: 12px; color: var(--text-muted); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 20px; background: var(--navy); color: #fff;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm); min-height: 48px;
}
.btn-google:hover { background: var(--navy-light); text-decoration: none; box-shadow: var(--shadow-md); }

/* ── Toast ──────────────────────────────────────────────────────── */
.putd-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast-item {
  background: var(--text-primary); color: #fff; padding: 12px 18px;
  border-radius: var(--radius-md); font-size: 14px; box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease; pointer-events: auto; max-width: 340px;
}
.toast-item.toast-success { background: var(--green); }
.toast-item.toast-error   { background: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (max-width: 900px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .login-brand { display: none; }
  .login-split { display: block; }
  .login-form-panel { min-height: 100vh; padding: 32px 24px; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .portal-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .portal-content { padding: 20px 16px; }
  .topbar { padding: 0 16px; height: 56px; }
  .topbar-title h1 { font-size: 15px; }
  .topbar-actions .btn span { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (max-width: 600px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .portal-content { padding: 14px 10px; }
  .topbar { height: 52px; gap: 10px; }
  .topbar-title h1 { font-size: 14px; }
  .topbar-title p { display: none; }
  .login-form-panel { padding: 24px 16px; }
  .login-card h2 { font-size: 22px; margin-bottom: 20px; }
  .putd-toast { bottom: 16px; left: 16px; right: 16px; }
  .toast-item { max-width: none; font-size: 13px; padding: 10px 14px; }
}
