/* Employee Portal — White-label template
   Theme colors injected via CSS custom properties from portal settings */

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

:root {
  --primary: #1B3A5C;
  --accent: #2A8B8B;
  --accent-light: #E8F4F4;
  --white: #FFFFFF;
  --paper: #FAFAF8;
  --slate: #4A5568;
  --slate-soft: #8A94A6;
  --line: #E8E6E1;
  --red: #B5442E;
  --red-light: #F7E4DF;
  --ochre: #E0A22C;
  --ochre-light: #FAEFD8;
  --green: #0E6B63;
  --green-light: #DCEAE7;
  --font: 'Inter', -apple-system, sans-serif;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--paper); color: var(--slate); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--primary); line-height: 1.2; }
a { color: var(--accent); text-decoration: none; }

/* Layout */
.topnav { background: var(--primary); color: var(--white); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.topnav-brand { color: var(--white); font-weight: 700; font-size: 15px; text-decoration: none; }
.topnav-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.topnav-user { color: var(--slate-soft); }
.topnav-btn { background: transparent; border: 1px solid rgba(255,255,255,0.25); color: var(--white); padding: 6px 14px; border-radius: var(--radius); font-family: var(--font); font-size: 13px; cursor: pointer; }

.container { max-width: 960px; margin: 0 auto; padding: 24px; }

.dashboard { display: grid; grid-template-columns: 240px 1fr; gap: 24px; min-height: calc(100vh - 56px); }

.sidebar { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--slate); cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: var(--font); transition: all 0.15s; }
.sidebar-item:hover { background: var(--white); }
.sidebar-item.active { background: var(--white); color: var(--primary); font-weight: 600; border: 1px solid var(--line); }
.sidebar-item svg { width: 18px; height: 18px; }

.main-content { padding: 0; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card h3 { font-size: 16px; margin-bottom: 12px; }

/* Section headers */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { font-size: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: none; border-radius: var(--radius); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--slate); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
input, select, textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font); font-size: 14px; color: var(--slate); background: var(--white); transition: border-color 0.15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,139,139,0.1); }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-full { grid-column: 1 / -1; }

/* Required/complete field states */
.form-group.required-empty input, .form-group.required-empty select { border: 2px solid var(--ochre); background: #FFFBF0; }
.form-group.required-empty label::after { content: ' — required'; font-size: 10px; font-weight: 400; color: var(--ochre); text-transform: none; letter-spacing: 0; }
.form-group.field-complete input, .form-group.field-complete select { border-color: var(--green); background: #F2FAF8; }

/* Doc list */
.doc-list { list-style: none; }
.doc-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-item:last-child { border-bottom: none; }
.doc-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.doc-meta { font-size: 12px; color: var(--slate-soft); }

/* Directory */
.dir-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dir-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.dir-info h4 { font-size: 14px; margin-bottom: 1px; }
.dir-info p { font-size: 12px; color: var(--slate-soft); }

/* Badge */
.badge { display: inline-flex; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-ochre { background: var(--ochre-light); color: #9a7a1b; }

/* Login */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 40px; max-width: 420px; width: 100%; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-card .subtitle { color: var(--slate-soft); margin-bottom: 28px; font-size: 14px; }
.accent-bar { width: 40px; height: 4px; background: var(--accent); border-radius: 2px; margin-bottom: 20px; }

/* Toast */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--white); transform: translateX(100%); opacity: 0; transition: all 0.3s; }
.toast-visible { transform: translateX(0); opacity: 1; }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--slate-soft); }
.empty-state h3 { color: var(--primary); margin-bottom: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .sidebar-item { white-space: nowrap; flex-shrink: 0; }
  .form-row { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  .topnav, .sidebar, .btn { display: none !important; }
  .dashboard { display: block; }
}
