/* ============================================================
   public/css/app.css  –  HR & Payroll Management System
   ============================================================ */

:root {
  --primary:   #1a56db;
  --primary-d: #1342b0;
  --danger:    #e02424;
  --success:   #0e9f6e;
  --warning:   #c27803;
  --bg:        #f3f4f6;
  --card:      #ffffff;
  --border:    #d1d5db;
  --text:      #111827;
  --muted:     #6b7280;
  --radius:    6px;
  --shadow:    0 1px 3px rgba(0,0,0,.12);
}

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

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg);
       color: var(--text); font-size: 14px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar { display: flex; align-items: center; gap: 16px;
          background: var(--primary); color: #fff;
          padding: 0 24px; height: 52px; }
.nav-brand { font-size: 18px; font-weight: 700; letter-spacing: .5px; flex-shrink: 0; }
.nav-links  { display: flex; list-style: none; gap: 4px; flex: 1; }
.nav-links a { color: #fff; padding: 6px 10px; border-radius: 4px;
               font-size: 13px; opacity: .9; }
.nav-links a:hover { opacity: 1; background: rgba(255,255,255,.15);
                     text-decoration: none; }
.nav-user  { display: flex; align-items: center; gap: 8px;
             font-size: 13px; white-space: nowrap; }
.nav-sep   { opacity: .4; }
.nav-logout { color: #fca5a5; }
.nav-logout:hover { color: #fff; }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: 1300px; margin: 24px auto; padding: 0 20px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius);
         margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px;
       padding: 8px 16px; border-radius: var(--radius); border: none;
       font-size: 13px; font-weight: 500; cursor: pointer;
       text-decoration: none; transition: opacity .15s; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary   { background: var(--primary);  color: #fff; }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-danger    { background: var(--danger);   color: #fff; }
.btn-link      { background: transparent; color: var(--primary); }
.btn-block     { width: 100%; justify-content: center; padding: 10px; font-size: 15px; }
.btn-sm        { padding: 4px 10px; font-size: 12px; border-radius: 4px;
                 border: none; cursor: pointer; }
.btn-edit      { background: #dbeafe; color: var(--primary); }
.btn-delete    { background: #fee2e2; color: var(--danger); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--muted);
                    text-transform: uppercase; letter-spacing: .4px; }
.form-group label em { font-weight: 400; text-transform: none; font-style: normal; }
input, select, textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.readonly { background: #f9fafb; color: var(--muted); }
textarea { resize: vertical; }

.form-grid   { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.span2       { grid-column: span 2; }
.form-actions { margin-top: 24px; display: flex; gap: 12px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius);
              box-shadow: var(--shadow); }
table  { width: 100%; border-collapse: collapse; background: var(--card); }
thead  { background: #f9fafb; }
th, td { padding: 10px 14px; text-align: left;
         border-bottom: 1px solid var(--border); font-size: 13px; }
th     { font-weight: 600; color: var(--muted); font-size: 12px;
         text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.actions     { display: flex; gap: 6px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-working   { background: #d1fae5; color: #065f46; }
.badge-resigned  { background: #fee2e2; color: #991b1b; }
.badge-retired   { background: #dbeafe; color: #1e40af; }
.badge-left      { background: #fef3c7; color: #92400e; }
.badge-temporary { background: #ede9fe; color: #5b21b6; }

/* ── Page header ──────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between;
               align-items: center; margin-bottom: 20px; }
.page-header h2 { font-size: 20px; font-weight: 700; }

/* ── Search bar ───────────────────────────────────────────── */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input, .search-bar select { max-width: 200px; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border);
        margin-bottom: 20px; }
.tab  { padding: 9px 18px; border: none; background: transparent;
        font-size: 13px; font-weight: 500; cursor: pointer;
        border-bottom: 2px solid transparent; margin-bottom: -2px;
        color: var(--muted); }
.tab.active { color: var(--primary); border-color: var(--primary); }
.tab-pane.hidden { display: none; }

/* ── Company history rows ─────────────────────────────────── */
.history-row { display: flex; gap: 8px; margin-bottom: 8px; }
.history-row input { flex: 1; }

/* ── Login page ───────────────────────────────────────────── */
.login-page { display: flex; align-items: center;
              justify-content: center; min-height: 100vh; background: var(--bg); }
.login-card { background: var(--card); border-radius: 10px;
              box-shadow: 0 4px 24px rgba(0,0,0,.12);
              padding: 40px; width: 380px; }
.login-header { text-align: center; margin-bottom: 28px; }
.login-header h1 { font-size: 26px; font-weight: 800; color: var(--primary); }
.login-header p  { color: var(--muted); margin-top: 4px; }
.login-card .form-group { margin-bottom: 16px; }

/* ── Dashboard ────────────────────────────────────────────── */
.dashboard-header { margin-bottom: 24px; }
.dashboard-header h2 { font-size: 22px; font-weight: 700; }
.dashboard-header p  { color: var(--muted); margin-top: 4px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
             gap: 16px; margin-bottom: 32px; }
.dash-card { background: var(--card); border-radius: 10px; padding: 28px 16px;
             text-align: center; box-shadow: var(--shadow);
             transition: transform .15s, box-shadow .15s; }
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.14);
                   text-decoration: none; }
.dash-icon  { font-size: 32px; margin-bottom: 8px; }
.dash-label { font-size: 13px; font-weight: 600; color: var(--text); }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-box  { background: var(--card); border-radius: 10px; padding: 20px;
             text-align: center; box-shadow: var(--shadow); }
.stat-num  { font-size: 32px; font-weight: 800; color: var(--primary); }
.stat-lbl  { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid   { grid-template-columns: 1fr; }
  .span2       { grid-column: span 1; }
  .navbar      { flex-wrap: wrap; height: auto; padding: 10px; }
  .nav-links   { display: none; }
  .stats-row   { grid-template-columns: 1fr; }
  .card-grid   { grid-template-columns: repeat(2, 1fr); }
}
