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

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       font-size: 14px; color: #333; background: #f5f5f5; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar { display: flex; align-items: center; justify-content: space-between;
          background: #1a3a5c; color: #fff; padding: 0 1.5rem; height: 52px; }
.navbar-brand { font-size: 1.1rem; font-weight: 700; letter-spacing: .5px; }
.navbar-home-btn { margin-left: 1rem; background: #2a5a8c; color: #fff !important;
                   text-decoration: none; padding: .25rem .75rem; border-radius: 4px;
                   font-size: .85rem; font-weight: 600; letter-spacing: .3px; }
.navbar-home-btn:hover { background: #3a7abf; }
.navbar-menu a { color: #cde; text-decoration: none; margin-left: 1.5rem; }
.navbar-menu a:hover { color: #fff; }
.navbar-user { margin-left: 1.5rem; opacity: .7; }

/* ── Container ──────────────────────────────────────────── */
.container { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.alert-error   { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }
.alert-info    { background: #d1ecf1; border: 1px solid #bee5eb; color: #0c5460; }

/* ── Page header ─────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between;
               margin-bottom: 1.2rem; }
.page-header h2 { font-size: 1.3rem; color: #1a3a5c; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-block; padding: .4rem .85rem; border-radius: 4px; font-size: .85rem;
       text-decoration: none; cursor: pointer; border: 1px solid #aaa;
       background: #fff; color: #333; transition: background .15s; }
.btn:hover { background: #e8e8e8; }
.btn-primary { background: #1a3a5c; color: #fff; border-color: #1a3a5c; }
.btn-primary:hover { background: #234f7a; }
.btn-sm { padding: .25rem .6rem; font-size: .8rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-group .btn { margin-left: .4rem; }

/* ── Forms ───────────────────────────────────────────────── */
.form-card { background: #fff; border-radius: 6px; padding: 1.5rem 2rem;
             box-shadow: 0 1px 4px rgba(0,0,0,.1); max-width: 560px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .875rem; }
.form-group input, .form-group select { width: 100%; padding: .45rem .7rem;
       border: 1px solid #ccc; border-radius: 4px; font-size: .875rem; }
.form-group small { display: block; color: #777; margin-top: .3rem; font-size: .78rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-weight: normal;
                  cursor: pointer; font-size: .875rem; }
.checkbox-label input[type="checkbox"] { width: auto; cursor: pointer; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }
.filter-form { margin-bottom: 1rem; }
.filter-form select { padding: .4rem .7rem; border: 1px solid #ccc; border-radius: 4px; }

/* ── Payroll detail email ────────────────────────────────── */
.table-toolbar { display: flex; align-items: center; justify-content: space-between;
                 margin-bottom: .5rem; }
.table-toolbar h3 { margin: 0; }
.col-check { width: 32px; text-align: center; }
.col-check input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; }
.emp-email { color: #2a5a8c; font-size: .75rem; }
.no-email  { color: #aaa; font-size: .75rem; font-style: italic; }

/* ── Login page ──────────────────────────────────────────── */
.login-page { background: #1a3a5c; display: flex; align-items: center;
              justify-content: center; min-height: 100vh; }
.login-card { background: #fff; border-radius: 8px; padding: 2.5rem 2rem;
              width: 340px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.login-card h1 { text-align: center; color: #1a3a5c; font-size: 1.4rem;
                  margin-bottom: 1.5rem; }

/* ── Tables ──────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; background: #fff;
         border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.table th, .table td { padding: .55rem .8rem; text-align: left;
                        border-bottom: 1px solid #eee; font-size: .85rem; }
.table th { background: #f0f4f8; font-weight: 600; color: #1a3a5c; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8fbff; }
.table-sm th, .table-sm td { padding: .35rem .6rem; font-size: .78rem; }
.text-right { text-align: right !important; }
.table-fixed td { word-break: break-word; }

/* ── Summary grid ────────────────────────────────────────── */
.summary-grid { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.summary-item { background: #fff; border-radius: 6px; padding: .75rem 1.1rem;
                border: 1px solid #dde; min-width: 130px; }
.summary-item .label { display: block; font-size: .75rem; color: #777; margin-bottom: .2rem; }
.summary-item .value { display: block; font-size: 1rem; font-weight: 700; color: #1a3a5c; }

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-toggle { cursor: pointer; color: #cde; padding: 0 .25rem; }
.dropdown-toggle:hover, .dropdown-toggle.active { color: #fff; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0;
                  background: #1a3a5c; border: 1px solid #2d5a8e; border-radius: 0 0 4px 4px;
                  min-width: 200px; z-index: 100; box-shadow: 0 4px 8px rgba(0,0,0,.3); }
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: .6rem 1rem; color: #cde; text-decoration: none;
                    font-size: .85rem; margin: 0; }
.dropdown-menu a:hover { background: #2d5a8e; color: #fff; }

/* ── Extra buttons ───────────────────────────────────────── */
.btn-danger  { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #e74c3c; }
.btn-warning { background: #e67e22; color: #fff; border-color: #e67e22; }
.btn-warning:hover { background: #f39c12; }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: #fff; border-radius: 6px; padding: 1rem 1.2rem;
        box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 1rem; }

/* ── Filter forms ────────────────────────────────────────── */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.filter-row label { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.filter-row input, .filter-row select { padding: .4rem .6rem; border: 1px solid #ccc;
       border-radius: 4px; font-size: .85rem; }

/* ── Inline add forms ────────────────────────────────────── */
.form-inline-add { margin-bottom: 1rem; }
.form-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .75rem; }
.form-row .form-group { flex: 1; min-width: 160px; }
.form-row .flex-grow { flex: 2; }
.form-row .form-group-btn { display: flex; align-items: flex-end; flex: 0; }
.form-card-wide { max-width: 900px; }

/* ── Navbar logout ───────────────────────────────────────── */
.navbar-logout { margin-left: 1.5rem; color: #aac !important; font-size: .8rem; }

/* ── Misc ────────────────────────────────────────────────── */
.text-muted { color: #888; font-size: .85rem; margin-bottom: .75rem; }
.empty { color: #888; font-style: italic; margin-top: 1rem; }
h3 { font-size: 1rem; color: #1a3a5c; margin: 1.2rem 0 .7rem; }
