:root {
    --navy-deep: #001050;
    --navy-mid: #002080;
    --blue-bright: #2070F0;
    --crimson: #F00050;
    --bg: #f5f6fa;
    --text: #1c1c28;
    --muted: #6b6b7b;
    --border: #e2e4ee;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--blue-bright); }

.site-header {
    background: var(--navy-deep);
    padding: 20px 24px;
    text-align: center;
}

.site-header img { height: 64px; }

.site-header .back-home {
    display: block;
    margin-top: 10px;
    color: #fff;
    opacity: 0.85;
    font-size: 13px;
    text-decoration: none;
}
.site-header .back-home:hover { opacity: 1; text-decoration: underline; }

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px;
}

.hero {
    text-align: center;
    margin-bottom: 36px;
}
.hero h1 { font-size: 28px; color: var(--navy-deep); margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 16px; }

.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 32px;
}
@media (min-width: 700px) {
    .category-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.category-card {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 26px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.15s, transform 0.15s;
}
.category-card:hover {
    box-shadow: 0 8px 24px rgba(0,16,80,0.12);
    transform: translateY(-2px);
}
.category-card .icon-bar { height: 5px; border-radius: 3px; margin-bottom: 16px; background: var(--blue-bright); }
.category-card h3 { margin: 0 0 8px; color: var(--navy-deep); font-size: 18px; }
.category-card p { margin: 0; font-size: 14px; color: var(--muted); }

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
}

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=password], input[type=datetime-local], select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-bright);
    box-shadow: 0 0 0 3px rgba(32,112,240,0.15);
}
textarea { resize: vertical; min-height: 90px; }

.btn {
    display: inline-block;
    background: var(--blue-bright);
    color: #fff;
    border: none;
    padding: 13px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn:hover { background: var(--navy-mid); }
.btn-block { display: block; width: 100%; }
.btn-secondary { background: #fff; color: var(--navy-deep); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--crimson); }

.alert {
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error { background: #fdeaef; color: #a10036; border: 1px solid #f5b8ce; }
.alert-success { background: #e9f7ee; color: #14663a; border: 1px solid #b7e3c6; }
.alert-info { background: #eaf1ff; color: #0d3f9c; border: 1px solid #b9d2fb; }

.required { color: var(--crimson); }

.field-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 600px) {
    .field-row-2 { grid-template-columns: 1fr 1fr; }
}

.footer-note {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-top: 28px;
}

/* ── Admin: sidebar layout ─────────────────────────────────── */
.admin-shell {
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
}

.admin-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--navy-deep);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar .sidebar-logo { padding: 0 20px 20px; }
.admin-sidebar .sidebar-logo img { height: 34px; }

.admin-sidebar nav { display: flex; flex-direction: column; }

.admin-sidebar .nav-section-label {
    padding: 16px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.45);
}

.admin-sidebar a {
    display: block;
    padding: 10px 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.admin-sidebar a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-sidebar a.active {
    background: rgba(255,255,255,0.1);
    border-left-color: var(--blue-bright);
    color: #fff;
    font-weight: 600;
}

.admin-sidebar .sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}
.admin-sidebar .sidebar-footer a {
    display: block;
    padding: 6px 0 0;
    color: #fff;
}

.admin-main { flex: 1; min-width: 0; }

@media (max-width: 780px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px;
    }
    .admin-sidebar .sidebar-logo { padding: 0 10px 0 0; }
    .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .admin-sidebar .nav-section-label { display: none; }
    .admin-sidebar a { padding: 6px 10px; border-left: none; border-radius: 4px; }
    .admin-sidebar a.active { border-left: none; }
    .admin-sidebar .sidebar-footer { margin-top: 0; border-top: none; padding: 6px 10px; }
    .admin-sidebar .sidebar-footer a { display: inline; padding: 0 0 0 8px; }
}

.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }

table.applicants-table { width: 100%; border-collapse: collapse; background: #fff; }
table.applicants-table th, table.applicants-table td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px;
}
table.applicants-table th { background: #f0f2fa; font-weight: 600; color: var(--navy-deep); }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #eaf1ff;
    color: var(--navy-mid);
}
.status-badge.new { background:#fff4e0; color:#8a5a00; }
.status-badge.rejected, .status-badge.declined_by_applicant, .status-badge.no_show, .status-badge.not_joining { background:#fdeaef; color:#a10036; }
.status-badge.offer_accepted, .status-badge.onboarding_ready { background:#e9f7ee; color:#14663a; }

.toolbar { display:flex; justify-content: space-between; align-items:center; margin-bottom:16px; flex-wrap:wrap; gap:12px; }
.filters { display:flex; gap:10px; flex-wrap:wrap; }
.filters select, .filters input { padding:8px 10px; border:1px solid var(--border); border-radius:6px; font-size:13px; }

/* Not Joining */
.nj-dialog { border: none; border-radius: 10px; padding: 24px; width: min(520px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
.nj-dialog::backdrop { background: rgba(10, 20, 50, 0.55); }
.nj-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.nj-reason { margin-top: 8px; padding: 8px 10px; max-width: 340px; white-space: normal; font-size: 12px; line-height: 1.5; background: #fdf3f6; border-left: 3px solid #a10036; border-radius: 4px; }

/* Calendar */
.cal-head { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.cal-legend { display:flex; gap:16px; flex-wrap:wrap; font-size:12px; color:var(--muted); margin-bottom:12px; align-items:center; }
.cal-legend i { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:4px; vertical-align:middle; }
.cal-legend i.lg-overdue { background:#fdeaef; border:1px solid #F00050; }
.cal-scroll { overflow-x:auto; }
.cal-grid { display:grid; grid-template-columns:repeat(7, minmax(120px, 1fr)); border-top:1px solid var(--border); border-left:1px solid var(--border); min-width:840px; }
.cal-dow { background:#f0f2fa; font-weight:600; font-size:12px; color:var(--navy-deep); padding:6px 8px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); }
.cal-cell { min-height:110px; padding:4px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); background:#fff; }
.cal-cell.out { background:#fafafc; }
.cal-cell.out .cal-daynum { opacity:0.4; }
.cal-cell.today { background:#eef4ff; box-shadow: inset 0 0 0 2px var(--blue-bright); }
.cal-daynum { font-size:12px; font-weight:600; color:var(--muted); margin-bottom:3px; }
.cal-ev { display:block; font-size:11.5px; line-height:1.3; padding:3px 5px; margin-bottom:3px; border-radius:3px; border-left:4px solid #888; background:#eaf1ff; color:var(--navy-deep); text-decoration:none; overflow:hidden; text-overflow:ellipsis; }
.cal-ev:hover { filter:brightness(0.95); }
.cal-ev.overdue { background:#fdeaef; outline:1px solid #F00050; }
.cal-ev.done { background:#f1f1f5; color:var(--muted); text-decoration:line-through; }
body.hide-done .cal-ev.done { display:none; }
.agenda-day { margin-bottom:18px; }
.agenda-date { font-weight:600; color:var(--navy-deep); padding:6px 0; border-bottom:2px solid var(--border); margin-bottom:6px; }
.agenda-date.today { color:var(--blue-bright); border-bottom-color:var(--blue-bright); }
.agenda-count { float:right; font-weight:400; font-size:12px; color:var(--muted); }
.agenda-row, .home-row { display:flex; gap:14px; padding:6px 0; border-bottom:1px solid #f0f0f5; }
.agenda-row.overdue { background:#fdf3f6; }
.agenda-time { min-width:88px; font-weight:600; color:var(--navy-deep); font-size:13px; white-space:nowrap; }

/* Overview */
.tile-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:14px; margin-bottom:20px; }
.tile { display:block; background:#fff; border:1px solid var(--border); border-radius:10px; padding:14px 16px; text-decoration:none; color:var(--text); }
.tile:hover { border-color:var(--blue-bright); }
.tile-count { font-size:30px; font-weight:700; color:var(--navy-deep); line-height:1.1; }
.tile-label { font-weight:600; font-size:13px; margin-top:2px; }
.tile-note { font-size:12px; color:var(--muted); }
.tile.tile-alert { border-color:#F00050; background:#fdf3f6; }
.tile.tile-alert .tile-count { color:#a10036; }
.home-cols { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:16px; }
.home-h { margin:0 0 10px; color:var(--navy-deep); font-size:16px; }
.hint { font-size: 12px; color: var(--muted); }

/* Internal notes */
.note-item { border-left: 3px solid var(--blue-bright); background: #f7f9ff; padding: 8px 12px; margin-bottom: 10px; border-radius: 0 6px 6px 0; font-size: 14px; }
.note-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.note-delete { background: none; border: none; color: var(--crimson); font-size: 12px; cursor: pointer; padding: 0; }
