/* ============================================================================
   REDI — shared theme
   Romblon State University's Research, Extension and Development
   Innovation Office. Same visual language as the university's HRDMO
   system (RSU green, card-based tables, pill badges, segmented tabs) so
   the two feel like one family of internal tools.
   ============================================================================ */

:root {
    --rsu-green: #006D3B;
    --rsu-green-dark: #004d2a;
    --rsu-light: #f0fdf4;
    --ink: #0f172a;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
    --amber: #b45309;
    --amber-bg: #fffbeb;
    --amber-line: #fde68a;
    --blue: #1d4ed8;
    --blue-bg: #eff6ff;
    --blue-line: #bfdbfe;
    --red: #b91c1c;
    --red-bg: #fef2f2;
    --red-line: #fecaca;
    --green: #15803d;
    --green-bg: #f0fdf4;
    --green-line: #bbf7d0;
    --violet: #6250d6;
    --violet-bg: #f1effc;
    --violet-line: #d9d4f6;
    --aqua: #0f8f67;
    --aqua-bg: #e8f8f2;
    --aqua-line: #bdebd9;
    --pink: #c23d73;
    --pink-bg: #fdf0f5;
    --pink-line: #f6cedf;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4,
.brand-title, .page-head h1, .card-title, .login-logo h1,
.stat-tile .stat-value {
    font-family: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -.01em;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, .15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, .28); }
* { scrollbar-width: thin; scrollbar-color: rgba(15, 23, 42, .15) transparent; }

/* ---------------------------------------------------------------- layout */
.app-shell { display: flex; min-height: 100vh; }
.page-shell { flex: 1; min-width: 0; padding: 28px 32px 48px; max-width: 1400px; }

.page-head { margin-bottom: 4px; }
.page-head h1 {
    font-size: 25px; font-weight: 800; margin: 0 0 5px; color: var(--ink);
    text-transform: uppercase; letter-spacing: -.01em;
}
.page-head p { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.scope-badge {
    display: inline-flex; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; border-radius: 11px;
    border: 1.5px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap; flex-shrink: 0;
}
.scope-badge i:first-child { color: var(--rsu-green); font-size: 12px; }
.scope-badge i:last-child { color: var(--faint); font-size: 10px; margin-left: 2px; }

/* ---------------------------------------------------------------- sidebar */
.redi-sidebar {
    width: 252px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-header { padding: 20px 18px 14px; border-bottom: 1px solid var(--line); }
.logo-wrapper { display: flex; align-items: center; gap: 10px; }
.logo-box { width: 38px; height: 38px; border-radius: 9px; overflow: hidden; flex-shrink: 0; background: var(--rsu-light); display: flex; align-items: center; justify-content: center; }
.logo-box img { width: 100%; height: 100%; object-fit: cover; }
.brand-title { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.brand-title span { color: var(--rsu-green); }
.brand-sub { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 14px 10px 6px; }
.nav-group-label:first-child { padding-top: 2px; }
.nav-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
    font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; margin-bottom: 2px;
    transition: background .12s, color .12s;
}
.nav-link i { width: 16px; text-align: center; font-size: 13px; }
.nav-link:hover { background: var(--rsu-light); color: var(--rsu-green); }
.nav-link.active { background: var(--rsu-green); color: #fff; }
.nav-sublink { font-size: 12.5px; padding: 8px 12px 8px 14px; }

.sidebar-footer { padding: 14px; border-top: 1px solid var(--line); }
.profile-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.profile-row { display: flex; align-items: center; gap: 10px; }
.avatar-circle {
    width: 36px; height: 36px; border-radius: 50%; background: var(--rsu-green); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.overflow-hidden { overflow: hidden; min-width: 0; }
.profile-name { font-size: 12.5px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { font-size: 10.5px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footer-actions { display: flex; gap: 6px; margin-top: 10px; }
.btn-footer-action {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 8px; border-radius: 9px; font-size: 11.5px; font-weight: 700;
    text-decoration: none; color: var(--muted); background: transparent;
    border: 1px solid var(--line); transition: background .12s, color .12s, border-color .12s;
}
.btn-footer-action i { font-size: 12px; }
.btn-footer-action:hover, .btn-footer-action.active { background: var(--rsu-light); color: var(--rsu-green); border-color: var(--green-line); }
.btn-footer-danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }

/* ---------------------------------------------------------------- buttons */
.btn-primary, .btn-add-employee {
    display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em; padding: 10px 18px; border-radius: 10px;
    background: var(--rsu-green); color: #fff; text-decoration: none; white-space: nowrap; flex-shrink: 0;
    border: none; font-family: inherit; cursor: pointer;
}
.btn-primary:hover, .btn-add-employee:hover { background: var(--rsu-green-dark); }
.btn-ghost {
    display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em; padding: 9px 15px; border-radius: 9px;
    border: 1.5px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
    text-decoration: none; font-family: inherit;
}
.btn-ghost:hover { border-color: var(--rsu-green); color: var(--rsu-green); background: var(--rsu-light); }
.btn-danger-outline {
    display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em; padding: 9px 15px; border-radius: 9px;
    border: 1.5px solid var(--red-line); background: #fff; color: var(--red); cursor: pointer;
    text-decoration: none; font-family: inherit;
}
.btn-danger-outline:hover { background: var(--red-bg); }
.btn-view {
    display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .04em; padding: 6px 13px; border-radius: 7px; background: var(--rsu-light); color: var(--rsu-green);
    text-decoration: none; border: 1px solid var(--green-line);
}
.btn-view:hover { background: var(--rsu-green); color: #fff; }

/* ---------------------------------------------------------------- filter bar (kept plain, on purpose) */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.filter-bar input[type="text"], .filter-bar select {
    padding: 9px 12px; border-radius: 9px; border: 1.5px solid var(--line); font-size: 12.5px;
    font-family: inherit; color: var(--ink); background: #fff;
}
.filter-bar input[type="text"]:focus, .filter-bar select:focus { outline: none; border-color: var(--rsu-green); }

/* ---------------------------------------------------------------- tabs / view pills */
.view-tabs { display: inline-flex; gap: 3px; background: #f1f5f9; border-radius: 12px; padding: 4px; margin: 14px 0 10px; flex-wrap: wrap; }
.view-tab {
    display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800;
    padding: 9px 15px; border-radius: 9px; color: var(--muted); text-decoration: none;
    transition: background .12s, color .12s; white-space: nowrap;
}
.view-tab:hover { color: #334155; }
.view-tab.active { background: #fff; color: var(--rsu-green); box-shadow: var(--shadow); }

.pill-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.pill-tab {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
    padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none;
    border: 1.5px solid var(--line); background: #fff; transition: background .12s, color .12s, border-color .12s;
}
.pill-tab:hover { border-color: var(--green-line); color: var(--rsu-green); background: var(--rsu-light); }
.pill-tab.active { border-color: var(--rsu-green); color: #fff; background: var(--rsu-green); }

/* ---------------------------------------------------------------- table */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead th {
    text-align: left; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: 12px 14px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.avatar-thumb { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--line); }
.mono-sub { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--muted); }
.empty-row { text-align: center; padding: 36px 14px !important; color: var(--faint); font-weight: 600; font-size: 13px; }

/* ---------------------------------------------------------------- badges */
.badge {
    display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-line);
}
.badge-outline {
    display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; background: #fff; color: var(--muted); border: 1px solid var(--line);
}
.badge-green {
    display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; background: var(--green-bg); color: var(--green); border: 1px solid var(--green-line);
}
.badge-blue {
    display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-line);
}
.badge-red {
    display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; background: var(--red-bg); color: var(--red); border: 1px solid var(--red-line);
}
.no-data { color: var(--faint); font-size: 12.5px; }

/* ---------------------------------------------------------------- pagination */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.pagination-info { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pagination-controls { display: flex; align-items: center; gap: 12px; }
.pagination-page { font-size: 11.5px; font-weight: 800; color: var(--ink); }
.btn-page {
    display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .04em; padding: 9px 15px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff;
    color: var(--ink); cursor: pointer; font-family: inherit;
}
.btn-page:hover:not(:disabled) { border-color: var(--rsu-green); color: var(--rsu-green); background: var(--rsu-light); }
.btn-page:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------------------------------------------------------- stat tiles (dashboard) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 18px 0; }
.stat-tile {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cbd5e1; }
.stat-tile .stat-icon {
    width: 36px; height: 36px; border-radius: 10px; background: var(--rsu-light); color: var(--rsu-green);
    display: flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 12px;
}
.stat-tile .stat-icon.is-blue   { background: var(--blue-bg);   color: var(--blue); }
.stat-tile .stat-icon.is-amber  { background: var(--amber-bg);  color: var(--amber); }
.stat-tile .stat-icon.is-red    { background: var(--red-bg);    color: var(--red); }
.stat-tile .stat-icon.is-violet { background: var(--violet-bg); color: var(--violet); }
.stat-tile .stat-icon.is-aqua   { background: var(--aqua-bg);   color: var(--aqua); }
.stat-tile .stat-icon.is-pink   { background: var(--pink-bg);   color: var(--pink); }
.stat-tile .stat-value { font-size: 27px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-tile .stat-label { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card-title { font-size: 13.5px; font-weight: 800; color: var(--ink); margin: 0 0 14px; }
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head-row .card-title { margin: 0; }
.card-total-chip {
    display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .04em; padding: 4px 11px; border-radius: 999px; background: var(--rsu-light); color: var(--rsu-green);
    border: 1px solid var(--green-line); white-space: nowrap;
}

/* ------------------------------------------------------------ vertical bar chart (dashboard) */
.vbar-chart { display: flex; align-items: flex-end; gap: 14px; overflow-x: auto; padding: 8px 2px 0; }
.vbar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1 0 56px; min-width: 56px; }
.vbar-value { font-family: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 800; color: var(--ink); }
.vbar-track { width: 100%; max-width: 46px; height: 148px; display: flex; align-items: flex-end; }
.vbar-fill { width: 100%; border-radius: 7px 7px 2px 2px; min-height: 4px; transition: height .25s ease; }
.vbar-label {
    font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.25;
    max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vbar-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; }
.vbar-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--muted); }
.vbar-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ---------------------------------------------------------------- forms */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; max-width: 980px; }
.form-section-title {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--rsu-green);
    margin: 26px 0 14px; padding-top: 18px; border-top: 1px solid var(--line);
}
.form-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full-width { grid-column: 1 / -1; }
.form-field label { font-size: 11.5px; font-weight: 800; color: var(--ink); }
.form-field .hint { font-size: 11px; color: var(--faint); font-weight: 500; }
.form-field input[type="text"], .form-field input[type="email"], .form-field input[type="password"],
.form-field input[type="number"], .form-field input[type="date"], .form-field select, .form-field textarea {
    padding: 10px 12px; border-radius: 9px; border: 1.5px solid var(--line); font-size: 13px;
    font-family: inherit; color: var(--ink); background: #fff; width: 100%;
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--rsu-green); }
.form-checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.form-actions { display: flex; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.repeater-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.repeater-row input { flex: 1; }
.btn-icon {
    width: 34px; height: 34px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
}
.btn-icon:hover { border-color: var(--red-line); color: var(--red); background: var(--red-bg); }
.btn-icon-add { border-color: var(--green-line); color: var(--rsu-green); background: var(--rsu-light); }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 12.5px; font-weight: 700; margin-bottom: 16px; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-line); }
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-line); }
.alert-info { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-line); }

/* ---------------------------------------------------------------- login page */
.login-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, var(--rsu-green) 0%, #004023 100%); padding: 24px;
}
.login-card { background: #fff; border-radius: 18px; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-logo img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.login-logo h1 { font-size: 18px; font-weight: 800; color: var(--ink); margin: 0; text-align: center; }
.login-logo p { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 2px 0 0; text-align: center; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 11.5px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.login-field input {
    width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13.5px; font-family: inherit;
}
.login-field input:focus { outline: none; border-color: var(--rsu-green); }
.login-submit {
    width: 100%; padding: 13px; border-radius: 10px; background: var(--rsu-green); color: #fff; border: none;
    font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; margin-top: 6px;
}
.login-submit:hover { background: var(--rsu-green-dark); }
.login-footer { text-align: center; font-size: 11px; color: var(--faint); margin-top: 20px; font-weight: 600; }

/* ---------------------------------------------------------------- misc */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 24px; }
.detail-field .detail-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 4px; }
.detail-field .detail-value { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.detail-field .detail-value.muted { color: var(--faint); font-weight: 500; }
.author-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.author-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); }
.file-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); margin-bottom: 6px; }
.file-chip i { color: var(--rsu-green); }
.file-chip:hover { border-color: var(--green-line); background: var(--rsu-light); }

@media (max-width: 900px) {
    .redi-sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
    .redi-sidebar.open { transform: translateX(0); }
    .page-shell { padding: 20px 16px 40px; }
}
