:root {
  --bg: #e2e8f0; 
  --card: #f8fafc; 
  --card-subtle: #f1f5f9; 
  --card-inner: #e2e8f0;
  --orange: #ea580c; 
  --orange-h: #c2410c; 
  --glow: rgba(234, 88, 12, 0.12);
  --dark: #1e293b; 
  --muted: #64748b; 
  --border: #cbd5e1; 
  --red: #ef4444;
  --blue: #2563eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, system-ui, sans-serif; min-height: 100vh; background: var(--bg); color: var(--dark); display: flex; flex-direction: column; padding-bottom: 36px; }

/* Layout & Auth */
.auth-container { flex: 1; display: flex; justify-content: center; align-items: center; padding: 20px; }
.card { background: var(--card); border-radius: 20px; max-width: 440px; width: 100%; padding: 40px 36px; box-shadow: 0 10px 25px -5px rgba(15,23,42,0.08); border: 1px solid var(--border); text-align: center; overflow: hidden; position: relative; }
.card::before { content: ''; position: absolute; top:0; left:0; right:0; height: 4px; background: linear-gradient(90deg, var(--orange), #f97316); }
.app-icon { width: 52px; height: 52px; background: var(--glow); border: 1px solid rgba(234,88,12,0.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.app-icon svg, .nav-icon svg, .fb-avatar svg { fill: var(--orange); }
.system-title { font-size: 20px; font-weight: 700; }
.org-subtitle { font-size: 13px; font-weight: 600; color: var(--orange); margin-top: 4px; }
.view-panel { display: none; }

/* Nav Header */
.navbar { background: var(--card); border-bottom: 1px solid var(--border); padding: 12px 32px; display: flex; justify-content: space-between; align-items: center; }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-icon { width: 36px; height: 36px; background: var(--glow); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.sys-name { font-size: 15px; font-weight: 700; }
.sub-name { font-size: 11.5px; font-weight: 600; color: var(--orange); }
.google-account-wrapper { display: flex; align-items: center; gap: 12px; }

/* Dashboard & Profile Header */
.dashboard-container { display: none; flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; padding: 0 24px 32px; flex-direction: column; gap: 20px; }
.fb-header-card { background: var(--card); border-radius: 0 0 16px 16px; border: 1px solid var(--border); border-top: none; overflow: hidden; }
.fb-cover-photo { height: 220px; background: linear-gradient(180deg, rgba(30,41,59,0.2), rgba(30,41,59,0.7)), url('ameera-bg.jpg') center 40%/cover no-repeat; }

.fb-profile-bar { padding: 0 24px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.fb-profile-left { display: flex; align-items: flex-start; gap: 20px; width: 100%; }
.fb-avatar-wrapper { position: relative; margin-top: -50px; flex-shrink: 0; }
.fb-avatar { width: 100px; height: 100px; background: var(--card); border: 4px solid var(--card); border-radius: 50%; box-shadow: 0 4px 12px rgba(15,23,42,0.15); display: flex; align-items: center; justify-content: center; }
.fb-avatar svg { width: 50px; height: 50px; }
.fb-details { padding-top: 12px; flex: 1; }
.fb-title { font-size: 22px; font-weight: 800; line-height: 1.2; word-break: break-word; }
.fb-subtitle { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 6px; display: flex; align-items: flex-start; gap: 6px; }
.address-icon { width: 16px; height: 16px; fill: var(--orange); flex-shrink: 0; margin-top: 2px; }
.fb-actions { padding-top: 12px; }

.btn-action { background: var(--orange); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-block; text-decoration: none; }
.btn-action:hover { background: var(--orange-h); }

/* Grid Layout */
.grid-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: 20px; }
.card-block { display: flex; flex-direction: column; gap: 8px; }
.card-block:not(:first-child) { margin-top: 20px; }

/* Headers & Cards */
.section-header { font-size: 14.5px; font-weight: 700; color: var(--dark); display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.section-header .badge { font-size: 11px; background: var(--glow); color: var(--orange); padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(234,88,12,0.2); }
.pms-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.placeholder-box { border: 2px dashed var(--border); border-radius: 10px; padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; background: var(--card-inner); }

/* Tasks Grid & Cards */
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.task-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease; display: flex; flex-direction: column; justify-content: space-between; }
.task-card:hover { transform: translateY(-2px); border-color: var(--orange); }
.task-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.task-title { font-size: 14px; font-weight: 700; color: var(--dark); margin: 0; line-height: 1.3; }
.task-badge { background: var(--glow); color: var(--orange); font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; border: 1px solid rgba(234,88,12,0.2); }
.task-latest-update { font-size: 12.5px; color: var(--muted); background: var(--card-subtle); padding: 10px; border-radius: 8px; border-left: 3px solid var(--orange); }
.task-latest-update p { margin: 4px 0 0 0; color: var(--dark); }
.task-card-footer { margin-top: 12px; font-size: 12px; color: var(--orange); font-weight: 600; text-align: right; }

/* Modal & Timeline Popup */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 1000; justify-content: center; align-items: center; padding: 20px; }
.modal-card { background: #ffffff; border-radius: 16px; width: 100%; max-width: 600px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); overflow: hidden; border: 1px solid var(--border); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--card); }
.modal-header h2 { margin: 0; font-size: 16px; color: var(--dark); font-weight: 700; }
.modal-close-btn { background: none; border: none; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; }

.timeline-wrapper { position: relative; padding-left: 20px; border-left: 2px solid var(--border); margin-left: 10px; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker { position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background-color: var(--orange); border: 2px solid #ffffff; box-shadow: 0 0 0 2px var(--orange); }

.timeline-content { 
  background: #ffffff; 
  padding: 12px 16px; 
  border-radius: 10px; 
  border: 1px solid var(--border);
}

.timeline-date { 
  display: block;
  color: var(--orange); 
  font-size: 15px; 
  font-weight: 800; 
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.timeline-text { 
  margin: 0; 
  font-size: 13px; 
  font-weight: 400;
  color: #334155; 
  line-height: 1.45; 
}

/* Public Holidays Styling */
.month-group-container { display: flex; flex-direction: column; gap: 16px; }
.month-group-block:not(:last-child) { border-bottom: 1px dashed var(--border); padding-bottom: 12px; }
.month-header-title { font-size: 12px; font-weight: 800; color: var(--orange); text-transform: uppercase; margin-bottom: 8px; }
.month-holiday-list { display: flex; flex-direction: column; gap: 8px; }
.holiday-item-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.holiday-date-badge { width: 38px; height: 38px; background: var(--orange); color: #fff; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.badge-num { font-size: 13px; font-weight: 800; line-height: 1; }
.badge-day { font-size: 8px; font-weight: 700; text-transform: uppercase; opacity: 0.9; }
.holiday-name-text { font-size: 13px; font-weight: 700; color: var(--dark); }

/* Quick Links Styling */
.quick-links-list { display: flex; flex-direction: column; gap: 8px; }
.quick-link-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--dark); font-size: 13px; font-weight: 600; transition: border-color 0.15s ease, transform 0.15s ease; }
.quick-link-item:hover { border-color: var(--orange); transform: translateY(-1px); }
.quick-link-left { display: flex; align-items: center; gap: 10px; }
.quick-link-type-icon { width: 18px; height: 18px; fill: var(--orange); flex-shrink: 0; }
.quick-link-external-icon { fill: var(--muted); width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }
.quick-link-item:hover .quick-link-external-icon { fill: var(--orange); opacity: 1; }

.version-footer { position: fixed; bottom: 12px; left: 16px; font-size: 11px; font-weight: 700; color: var(--orange); background: rgba(254, 243, 199, 0.9); padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(234,88,12,0.3); z-index: 1000; }

@media (max-width: 768px) {
  .grid-3-1 { grid-template-columns: 1fr; }
  .navbar { padding: 10px 16px; }
  .sub-name { display: none; }
  .dashboard-container { padding: 0 12px 48px; }
  .fb-cover-photo { height: 160px; }
  .fb-profile-bar { flex-direction: column; padding: 0 16px 16px; gap: 10px; }
  .fb-profile-left { flex-direction: column; gap: 0; }
  .fb-avatar-wrapper { margin-top: -40px; }
  .fb-avatar { width: 80px; height: 80px; }
  .fb-avatar svg { width: 40px; height: 40px; }
  .fb-details { padding-top: 8px; }
  .fb-title { font-size: 18px; }
  .fb-actions { padding-top: 0; }
}