/* DepEd-inspired stylesheet for the IPCRF application */
:root {
    --depblue: #003399;
    --depred: #c8102e;
    --depyellow: #ffcc00;
    --depwhite: #ffffff;
    --depgray: #f4f7fb;
    --deptext: #1f305f;
    --depshadow: rgba(7, 31, 78, 0.14);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f9fbff 0%, #d8e4ff 100%);
    color: var(--deptext);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-layout {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--depwhite);
    border-radius: 18px;
    box-shadow: 0 18px 42px var(--depshadow);
    padding: 32px;
    border: 1px solid rgba(0, 51, 153, 0.08);
}

.login-card h2 {
    margin: 0 0 20px;
    font-size: 1.9rem;
    letter-spacing: -0.02em;
    color: var(--depblue);
}

.login-card p {
    margin: 0 0 24px;
    color: #4a5679;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #334165;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d7e1f4;
    border-radius: 12px;
    background: #fbfdff;
    font-size: 0.98rem;
    color: #1f2e56;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--depblue);
    box-shadow: 0 0 0 4px rgba(0, 51, 153, 0.08);
}

button,
.btn {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--depblue) 0%, #4266d5 100%);
    color: var(--depwhite);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    background: #002f80;
}

.login-card .message,
.admin-card .message {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff0f1;
    color: #b21b34;
    font-size: 0.95rem;
}

.login-card .message--success,
.admin-card .message--success {
    background: #e9f9ef;
    color: #177a3f;
}

.admin-card .message--info {
    background: #eef3ff;
    color: var(--depblue);
    margin: 6px 0 14px;
}

.footer-note {
    margin-top: 24px;
    text-align: center;
    color: #66749f;
    font-size: 0.92rem;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.header-brand__mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--depblue), var(--depyellow));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--depwhite);
    font-weight: 800;
    font-size: 1.1rem;
}

.header-brand__text {
    font-size: 1rem;
    letter-spacing: 0.02em;
}

@media (max-width: 920px) {
    .auth-layout {
        grid-template-columns: 1fr;
        max-width: 460px;
    }

    .login-card {
        max-width: 100%;
    }
}

@media (max-width: 500px) {
    .login-card {
        padding: 24px;
    }
}

/* Wizard / Step Form */
.wizard-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.wizard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.wizard-tab {
    flex: 1;
    border: 1px solid #c8d5f0;
    background: #eaf0ff;
    color: #1f305f;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
}

.wizard-tab.active {
    background: linear-gradient(135deg, var(--depblue) 0%, #4266d5 100%);
    color: #fff;
    border-color: var(--depblue);
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

.intro-board {
    background: #b7de98;
    border: 3px solid var(--depblue);
    border-radius: 8px;
    padding: 28px;
}

.intro-board h1 {
    margin: 0;
    text-align: center;
    color: #000;
    font-size: 2rem;
}

.intro-board h2 {
    margin: 10px 0 20px;
    text-align: center;
    color: #000;
    font-size: 2rem;
}

.intro-board p {
    color: #000;
    font-size: 1.25rem;
    line-height: 1.5;
    margin-bottom: 18px;
}

.intro-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 14px 16px;
    align-items: center;
    margin-top: 16px;
}

.intro-grid label {
    font-size: 2rem;
    font-weight: 700;
    color: #000;
}

.intro-grid input,
.intro-grid select {
    font-size: 1.25rem;
    border-radius: 0;
    border: 1px solid #4c608f;
    background: #fff;
}

.form-card {
    max-width: 820px;
    margin: 0 auto;
}

.wizard-actions {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.wizard-actions.split {
    justify-content: space-between;
}

.btn-next,
.btn-back,
.link-btn {
    width: auto;
    min-width: 160px;
    padding: 12px 20px;
}

.btn-back {
    background: #7f8fb7;
}

.btn-back:hover {
    background: #6b7ba3;
}

.review-box {
    border: 1px solid #d7e1f4;
    border-radius: 12px;
    background: #fbfdff;
    padding: 16px;
    margin-bottom: 16px;
}

.review-box p {
    margin: 8px 0;
}

.review-box__title {
    margin: 0 0 10px;
    color: var(--depblue);
    font-size: 1.05rem;
}

.review-warning {
    color: #b21b34;
    font-weight: 700;
    display: none;
}

.final-review-card {
    max-width: 720px;
}

.wizard-tab--final {
    background: #ffcc00;
    color: #1f305f;
    border-color: #d9a900;
}

.wizard-tab--final.active {
    background: linear-gradient(135deg, #d9a900 0%, #ffcc00 100%);
    color: #1f305f;
}

.required-mark {
    color: #c8102e;
    font-weight: 800;
}

.demo-fieldset {
    border: 2px solid #2f3e63;
    border-radius: 4px;
    padding: 16px;
    margin: 0 0 16px;
    background: rgba(255, 255, 255, 0.25);
}

.demo-fieldset legend {
    padding: 0 8px;
    font-weight: 800;
    color: #000;
    font-size: 1.05rem;
}

.demo-section-title {
    margin: 0 0 10px;
    color: #000;
    font-size: 1.15rem;
}

.demographic-board {
    padding: 24px;
}

.demographic-board h2 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #000;
    text-align: left;
}

.demo-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 10px 14px;
    align-items: center;
}

.demo-grid input[readonly] {
    background: #eef3ff;
    color: #41557f;
    cursor: not-allowed;
}

.demo-grid label {
    font-weight: 700;
    color: #000;
    font-size: 1rem;
}

.demo-grid input,
.demo-grid select {
    border-radius: 0;
    border: 1px solid #41557f;
    background: #fff;
    padding: 10px 12px;
}

.checkbox-panels {
    margin-top: 22px;
    display: grid;
    gap: 16px;
}

.checkbox-panel {
    border: 2px solid #2f3e63;
    background: rgba(255, 255, 255, 0.2);
    padding: 14px;
}

.checkbox-panel h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: #000;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 8px 18px;
    margin-bottom: 10px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #000;
}

.checkbox-panel > label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: #000;
}

.checkbox-panel input[type="text"] {
    border-radius: 0;
    border: 1px solid #41557f;
    background: #fff;
}

@media (max-width: 900px) {
    .demo-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin View */
.admin-wrapper {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.admin-card {
    width: 100%;
    background: var(--depwhite);
    border-radius: 18px;
    box-shadow: 0 18px 42px var(--depshadow);
    padding: 28px;
    border: 1px solid rgba(0, 51, 153, 0.08);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-header h2 {
    margin: 0;
    color: var(--depblue);
}

.admin-header p {
    margin: 8px 0 0;
    color: #4a5679;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-inline {
    width: auto;
    min-width: 170px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-muted {
    background: #7f8fb7;
}

.btn-muted:hover {
    background: #6b7ba3;
}

.admin-reset {
    display: grid;
    grid-template-columns: 280px 1fr 220px 1fr auto;
    gap: 10px;
    align-items: center;
    margin: 6px 0 14px;
}

.admin-form {
    max-width: 480px;
    margin: 6px 0 24px;
}

.admin-form .btn {
    width: auto;
    min-width: 180px;
}

.admin-reset label {
    font-weight: 700;
    color: #334165;
}

.admin-filter {
    display: grid;
    grid-template-columns: 280px 1fr auto auto;
    gap: 10px;
    align-items: center;
    margin: 14px 0 18px;
}

.admin-filter label {
    font-weight: 700;
    color: #334165;
}

.admin-filter .link-btn {
    min-width: auto;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #c8d5f0;
    color: var(--depblue);
    background: #eef3ff;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid #d7e1f4;
    border-radius: 12px;
    background: #fff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.admin-table thead th {
    background: #ecf2ff;
    color: #1f305f;
    font-weight: 700;
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #d7e1f4;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #edf2fb;
    color: #21335f;
    vertical-align: top;
}

.admin-table tbody tr:nth-child(even) {
    background: #fbfdff;
}

.admin-empty {
    text-align: center;
    color: #65759f;
    padding: 20px !important;
}

/* Principal dashboard */
.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 6px 0 22px;
}

.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 18px 10px;
    border-radius: 12px;
    background: #eef3ff;
    border: 1px solid #d7e1f4;
}

.stat-tile__value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--depblue);
}

.stat-tile__label {
    font-size: 0.85rem;
    color: #4a5679;
    font-weight: 600;
}

.stat-tile--good {
    background: #e9f9ef;
    border-color: #bfe9cf;
}

.stat-tile--good .stat-tile__value {
    color: #177a3f;
}

.stat-tile--bad {
    background: #fff0f1;
    border-color: #f3c2c9;
}

.stat-tile--bad .stat-tile__value {
    color: #b21b34;
}

.stat-tile--muted .stat-tile__value {
    color: #65759f;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge--good {
    background: #e9f9ef;
    color: #177a3f;
}

.badge--bad {
    background: #fff0f1;
    color: #b21b34;
}

.badge--muted {
    background: #edf1fa;
    color: #65759f;
}

.charts-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

.chart-panel {
    background: #fff;
    border: 1px solid #d7e1f4;
    border-radius: 12px;
    padding: 16px;
}

.chart-panel h3 {
    margin: 0 0 16px;
    color: #1f305f;
    font-size: 1.05rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 220px;
    overflow-x: auto;
    padding: 0 4px 4px;
    border-bottom: 2px solid #d7e1f4;
}

.chart-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 56px;
}

.chart-bar-value {
    font-weight: 700;
    color: #1f305f;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.chart-bar {
    width: 34px;
    border-radius: 6px 6px 0 0;
    min-height: 6px;
}

.chart-bar-label {
    margin-top: 8px;
    font-size: 0.78rem;
    color: #4a5679;
    text-align: center;
    max-width: 80px;
    overflow-wrap: break-word;
}

.chart-pie-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.chart-pie {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #21335f;
}

.chart-legend__swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* Step 5 IPCRF table */
.step5-wrap {
    background: #d49a9a;
    border: 2px solid #111;
    padding: 10px;
}

.step5-wrap h2 {
    margin: 0 0 10px;
    color: #111;
    text-align: left;
    font-size: 1.2rem;
}

.step5-table-scroll {
    overflow-x: auto;
    border: 1px solid #111;
    background: #d49a9a;
}

.step5-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 1700px;
    table-layout: fixed;
    font-size: 12px;
    color: #000;
}

.step5-table th,
.step5-table td {
    border: 1px solid #111;
    padding: 3px 4px;
    vertical-align: middle;
    text-align: center;
    background: #d49a9a;
}

.step5-table th {
    font-weight: 700;
}

.step5-table input[type="text"],
.step5-table input[type="email"] {
    width: 100%;
    border: 1px solid #111;
    border-radius: 0;
    padding: 4px 6px;
    background: #fff;
    min-height: 26px;
    font-size: 12px;
    color: #000;
    box-shadow: none;
}

.step5-table .text-right {
    text-align: right;
    padding-right: 10px;
}

.step5-signatory-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sign-card {
    border: 1px solid #111;
    background: #d49a9a;
    padding: 10px;
}

.sign-card label {
    display: block;
    font-weight: 700;
    margin: 8px 0 4px;
    color: #000;
}

.sign-card input[type="text"],
.sign-card input[type="email"] {
    border: 1px solid #111;
    border-radius: 0;
    background: #fff;
    padding: 8px 10px;
}

.sign-card input[readonly] {
    background: #eef3ff;
    font-weight: 700;
    cursor: not-allowed;
}

/* Part I-IV additions */
.step-hint {
    margin: 6px 0 14px;
    color: #4a5679;
}

.step-hint--dark {
    color: #111;
    font-weight: 600;
}

.ipcrf-header-table {
    min-width: 100%;
    margin-bottom: 10px;
}

.ipcrf-rating-table {
    min-width: 2000px;
}

.ipcrf-rating-table th {
    background: #c98a8a;
}

.ipcrf-kra-banner td {
    background: #4266d5 !important;
    color: #fff !important;
    font-weight: 800;
    text-align: left !important;
    padding: 8px 10px !important;
    font-size: 13px;
}

.ipcrf-obj-banner td {
    background: #eaf0ff !important;
    color: #002f80 !important;
    font-weight: 700;
    text-align: left !important;
    padding: 6px 10px !important;
    font-size: 12px;
}

.rubric-cell {
    text-align: left !important;
    font-size: 11px;
    line-height: 1.35;
    max-width: 220px;
    background: #fbfdff !important;
    color: #1f2e56 !important;
}

.step5-table textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid #111;
    border-radius: 0;
    padding: 4px 6px;
    background: #fff;
    font-size: 12px;
    color: #000;
    resize: vertical;
    box-shadow: none;
}

.step5-table select {
    width: 100%;
    border: 1px solid #111;
    border-radius: 0;
    padding: 4px;
    background: #fff;
    font-size: 12px;
    color: #000;
    box-shadow: none;
}

.step5-table input[readonly] {
    background: #eef3ff;
    font-weight: 700;
    text-align: center;
}

.ipcrf-final-row th,
.ipcrf-final-row td {
    background: #ffe9a8 !important;
    color: #000 !important;
    font-weight: 800;
}

.ipcrf-summary-table td.text-left {
    text-align: left !important;
}

/* Part II competencies */
.comp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 10px;
}

.comp-panel {
    border: 2px solid #2f3e63;
    background: rgba(255, 255, 255, 0.75);
    padding: 14px;
}

.comp-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.comp-panel__head h3 {
    margin: 0;
    color: #000;
    font-size: 1.1rem;
}

.comp-total-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #000;
    font-size: 0.9rem;
}

.comp-total-label input {
    width: 60px;
    text-align: center;
    border: 1px solid #41557f;
    border-radius: 0;
    background: #eef3ff;
    padding: 6px;
    font-weight: 800;
}

.comp-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.92rem;
    color: #000;
    margin-bottom: 8px;
    line-height: 1.4;
}

.comp-item input {
    margin-top: 4px;
}

/* Part IV development plan */
.devplan-table {
    min-width: 1400px;
}

.devplan-table input[type="text"] {
    border: 1px solid #111;
    border-radius: 0;
    background: #fff;
    padding: 6px 8px;
    font-size: 12px;
    color: #000;
    min-height: 34px;
    box-shadow: none;
}

.btn-addrow {
    width: auto;
    min-width: 140px;
    background: #2f7a4f;
}

.btn-addrow:hover {
    background: #245f3c;
}

@media (max-width: 900px) {
    .comp-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .intro-grid {
        grid-template-columns: 1fr;
    }

    .intro-grid label {
        font-size: 1.35rem;
    }

    .intro-board h1 {
        font-size: 1.45rem;
    }

    .intro-board h2 {
        font-size: 1.35rem;
    }

    .intro-board p {
        font-size: 1.05rem;
    }

    .wizard-actions.split {
        flex-direction: column;
    }

    .btn-next,
    .btn-back,
    .link-btn {
        width: 100%;
    }

    .admin-header {
        flex-direction: column;
    }

    .admin-actions {
        width: 100%;
    }

    .btn-inline {
        width: 100%;
    }

    .admin-reset,
    .admin-filter {
        grid-template-columns: 1fr;
    }

    .step5-signatory-grid {
        grid-template-columns: 1fr;
    }
}
