/* PeopleDesk Employee Portal v1.2.0 — Standalone, no theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --pdp-primary: #1482A5;
  --pdp-primary-dark: #0f6585;
  --pdp-primary-light: #e8f4f8;
  --pdp-bg: #f0f4f8;
  --pdp-surface: #ffffff;
  --pdp-border: #e2e8f0;
  --pdp-text: #0f172a;
  --pdp-muted: #64748b;
  --pdp-success: #10b981;
  --pdp-warning: #f59e0b;
  --pdp-danger: #ef4444;
  --pdp-info: #3b82f6;
  --pdp-nav-bg: #0d1b2a;
  --pdp-radius: 12px;
  --pdp-shadow: 0 1px 4px rgba(0,0,0,.08);
  --pdp-shadow-md: 0 4px 20px rgba(0,0,0,.1);
}

/* Reset for standalone page */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, .pd-portal-body { height: 100%; }
body.pd-portal-body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--pdp-bg); color: var(--pdp-text); overflow: hidden; }

/* ── Login ── */
.pdp-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%); padding: 20px; }
.pdp-login-card { background: #fff; border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.pdp-login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pdp-logo-icon svg, .pdp-logo-icon-sm svg { display: block; }
.pdp-logo-icon svg { width: 44px; height: 44px; }
.pdp-logo-icon-sm svg { width: 32px; height: 32px; }
.pdp-lm { font-size: 22px; font-weight: 800; color: #0d1b2a; }
.pdp-la { font-size: 22px; font-weight: 800; color: var(--pdp-primary); }
.pdp-company-name { font-size: 13px; font-weight: 600; color: var(--pdp-muted); margin: 0 0 16px; letter-spacing: .3px; }
.pdp-login-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.pdp-login-sub { font-size: 13.5px; color: var(--pdp-muted); margin-bottom: 24px; }
.pdp-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ── Shell ── */
#peopledesk-portal-app { position: fixed; inset: 0; z-index: 9999; background: var(--pdp-bg); overflow: hidden; }
.pdp-shell { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* ── Header ── */
.pdp-header {
  background: var(--pdp-nav-bg); height: 56px; display: flex; align-items: center;
  padding: 0 20px; gap: 16px; flex-shrink: 0; overflow-x: auto;
}
.pdp-header-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pdp-lm, .pdp-la { font-size: 15px; }
.pdp-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.pdp-nav::-webkit-scrollbar { display: none; }
.pdp-nb {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; border-radius: 8px; border: none; background: none;
  color: rgba(255,255,255,.55); cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 600; white-space: nowrap; transition: all .12s; flex-shrink: 0;
}
.pdp-nb:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.07); }
.pdp-nb--active { color: #fff; background: var(--pdp-primary) !important; }
.pdp-nb svg { width: 18px; height: 18px; flex-shrink: 0; }

.pdp-header-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }
.pdp-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--pdp-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.pdp-uname { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.8); display: none; }
@media(min-width:640px) { .pdp-uname { display: block; } }
.pdp-logout-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.7); border-radius: 8px; padding: 6px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; font-family: inherit; transition: all .12s; }
.pdp-logout-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.pdp-install-btn { display: none; align-items: center; gap: 6px; background: var(--pdp-primary); border: none; color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }

/* ── Main ── */
.pdp-main { flex: 1; overflow-y: auto; padding: 20px 16px; -webkit-overflow-scrolling: touch; }
@media(min-width:640px) { .pdp-main { padding: 24px 24px; } }

/* ── Page ── */
.pdp-page { display: flex; flex-direction: column; gap: 16px; max-width: 860px; margin: 0 auto; }

/* ── Cards ── */
.pdp-card { background: var(--pdp-surface); border-radius: var(--pdp-radius); border: 1px solid var(--pdp-border); box-shadow: var(--pdp-shadow); overflow: hidden; }
.pdp-card-head { padding: 14px 18px; border-bottom: 1px solid var(--pdp-border); }
.pdp-card-head h3 { font-size: 14.5px; font-weight: 700; }

/* ── Check-in card ── */
.pdp-checkin-card { background: linear-gradient(135deg, #0d1b2a 0%, var(--pdp-primary) 100%); border-radius: var(--pdp-radius); padding: 24px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.pdp-clock { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.pdp-date { font-size: 13px; opacity: .75; margin-top: 4px; }
.pdp-ci-info { margin-top: 10px; display: flex; gap: 16px; font-size: 13px; opacity: .8; }
.pdp-ci-btn { padding: 12px 28px; border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border: none; transition: all .15s; }
.pdp-ci-btn--in { background: #fff; color: var(--pdp-primary); }
.pdp-ci-btn--in:hover { background: #f0f9ff; transform: scale(1.02); }
.pdp-ci-btn--out { background: var(--pdp-warning); color: #fff; }
.pdp-ci-btn--out:hover { background: #d97706; transform: scale(1.02); }
.pdp-ci-btn:disabled { opacity: .6; transform: none; cursor: not-allowed; }
.pdp-ci-done { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.15); border-radius: 10px; padding: 12px 20px; font-size: 14px; font-weight: 600; }

/* ── Summary row ── */
.pdp-summary-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.pdp-sum-item { background: var(--pdp-surface); border: 1px solid var(--pdp-border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pdp-sum-item strong { font-size: 22px; font-weight: 800; color: var(--pdp-primary); }
.pdp-sum-item span { font-size: 12px; color: var(--pdp-muted); font-weight: 500; }

/* ── Attendance log ── */
.pdp-att-log { padding: 4px 0; }
.pdp-att-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid #f1f5f9; gap: 12px; font-size: 13.5px; }
.pdp-att-row:last-child { border: none; }
.pdp-att-date { font-weight: 600; white-space: nowrap; min-width: 100px; }
.pdp-att-times { display: flex; gap: 6px; color: var(--pdp-muted); font-size: 12.5px; align-items: center; }
.pdp-empty-msg { text-align: center; padding: 32px; color: var(--pdp-muted); font-size: 14px; }

/* ── Badges ── */
.pdp-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pdp-badge--success { background: #dcfce7; color: #15803d; }
.pdp-badge--warning { background: #fef9c3; color: #854d0e; }
.pdp-badge--danger  { background: #fee2e2; color: #b91c1c; }
.pdp-badge--info    { background: #dbeafe; color: #1d4ed8; }
.pdp-badge--neutral { background: #f1f5f9; color: var(--pdp-muted); }
.pdp-badge-today { background: var(--pdp-primary); color: #fff; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; margin-left: 6px; }
.pdp-tag-sm { display: inline-block; font-size: 11px; color: var(--pdp-muted); font-weight: 500; text-transform: capitalize; }

/* ── Leave balances ── */
.pdp-balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.pdp-balance-card { background: var(--pdp-surface); border: 1px solid var(--pdp-border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.pdp-bal-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pdp-bal-info { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.pdp-bal-info strong { font-weight: 700; }
.pdp-bal-info span { font-size: 12px; color: var(--pdp-muted); }
.pdp-bal-bar-wrap { height: 5px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.pdp-bal-bar { height: 100%; border-radius: 99px; transition: width .4s; }

/* ── Forms ── */
.pdp-field { display: flex; flex-direction: column; gap: 5px; }
.pdp-field label { font-size: 12px; font-weight: 700; color: var(--pdp-muted); text-transform: uppercase; letter-spacing: .4px; }
.pdp-field--full { grid-column: span 2; }
.pdp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pdp-input { width: 100%; padding: 9px 13px; border: 1.5px solid var(--pdp-border); border-radius: 8px; font-family: inherit; font-size: 13.5px; color: var(--pdp-text); background: #fff; outline: none; transition: border-color .15s; }
.pdp-input:focus { border-color: var(--pdp-primary); box-shadow: 0 0 0 3px rgba(20,130,165,.1); }
.pdp-textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.pdp-leave-form { padding: 16px 18px; }

/* ── Buttons ── */
.pdp-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 8px; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; transition: all .15s; }
.pdp-btn--primary { background: var(--pdp-primary); color: #fff; border-color: var(--pdp-primary); }
.pdp-btn--primary:hover { background: var(--pdp-primary-dark); }
.pdp-btn--outline { background: transparent; border-color: var(--pdp-border); color: var(--pdp-text); }
.pdp-btn--full { width: 100%; justify-content: center; }
.pdp-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Notices ── */
.pdp-notice-item { background: var(--pdp-surface); border: 1px solid var(--pdp-border); border-radius: var(--pdp-radius); display: flex; overflow: hidden; }
.pdp-notice-bar { width: 5px; flex-shrink: 0; }
.pdp-notice-body { padding: 16px 18px; flex: 1; }
.pdp-notice-body h4 { font-size: 15px; font-weight: 700; margin: 6px 0 8px; }
.pdp-notice-body p { font-size: 13.5px; color: var(--pdp-muted); line-height: 1.6; }
.pdp-notice-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }

/* ── Directory ── */
.pdp-dir-search-wrap { position: relative; display: flex; align-items: center; }
.pdp-dir-search-wrap svg { position: absolute; left: 13px; color: var(--pdp-muted); }
.pdp-dir-search { width: 100%; padding: 11px 16px 11px 40px; border: 1.5px solid var(--pdp-border); border-radius: 10px; font-family: inherit; font-size: 14px; background: var(--pdp-surface); outline: none; }
.pdp-dir-search:focus { border-color: var(--pdp-primary); box-shadow: 0 0 0 3px rgba(20,130,165,.1); }
.pdp-dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 12px; margin-top: 4px; }
.pdp-dir-card { background: var(--pdp-surface); border: 1px solid var(--pdp-border); border-radius: 10px; padding: 16px; display: flex; align-items: flex-start; gap: 14px; }
.pdp-dir-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--pdp-primary-light); color: var(--pdp-primary); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; flex-shrink: 0; }
.pdp-dir-info { display: flex; flex-direction: column; gap: 2px; font-size: 13px; overflow: hidden; }
.pdp-dir-info strong { font-size: 14px; font-weight: 700; }
.pdp-dir-info span { color: var(--pdp-muted); font-size: 12.5px; }
.pdp-dir-email { color: var(--pdp-primary); text-decoration: none; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ── Profile ── */
.pdp-profile-hero { background: linear-gradient(135deg, #0d1b2a 0%, var(--pdp-primary) 100%); border-radius: var(--pdp-radius); padding: 30px; text-align: center; color: #fff; }
.pdp-profile-hero h2 { font-size: 20px; font-weight: 800; margin: 12px 0 4px; }
.pdp-profile-hero .pdp-muted { color: rgba(255,255,255,.7); }
.pdp-profile-av { width: 68px; height: 68px; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; margin: 0 auto; border: 3px solid rgba(255,255,255,.3); }
.pdp-profile-grid { display: grid; grid-template-columns: repeat(2,1fr); }
.pdp-pi { padding: 11px 18px; border-bottom: 1px solid #f1f5f9; }
.pdp-pi label { font-size: 11px; font-weight: 700; color: var(--pdp-muted); text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 2px; }
.pdp-pi p { font-size: 13.5px; font-weight: 500; }
.pdp-pi--full { grid-column: span 2; }
.pdp-muted-sm { font-size: 12px; color: var(--pdp-muted); margin-top: 2px; }

/* ── Empty state ── */
.pdp-empty-state { display: flex; align-items: center; justify-content: center; min-height: 200px; color: var(--pdp-muted); font-size: 14px; }

/* ── Toast ── */
.pdp-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 12px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 600; box-shadow: 0 4px 20px rgba(0,0,0,.2); z-index: 99999; white-space: nowrap; animation: pdpSlide .2s ease; }
.pdp-toast--success { background: #0d1b2a; color: #fff; }
.pdp-toast--error { background: var(--pdp-danger); color: #fff; }
@keyframes pdpSlide { from { transform: translateX(-50%) translateY(20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* ── Loader ── */
.pdp-loader-wrap { display: flex; align-items: center; justify-content: center; height: 200px; width: 100%; }
.pdp-loader { width: 32px; height: 32px; border: 3px solid var(--pdp-border); border-top-color: var(--pdp-primary); border-radius: 50%; animation: pdpspin .6s linear infinite; }
@keyframes pdpspin { to { transform: rotate(360deg); } }

/* ── Mobile responsive ── */
@media(max-width:520px) {
  .pdp-stats-row { grid-template-columns: repeat(2,1fr); }
  .pdp-summary-row { grid-template-columns: repeat(2,1fr); }
  .pdp-form-grid { grid-template-columns: 1fr; }
  .pdp-field--full { grid-column: span 1; }
  .pdp-pi--full { grid-column: span 2; }
  .pdp-checkin-card { flex-direction: column; text-align: center; }
}
