* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #17211f;
    background: #f4f7f5;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
    color: #0f5d59;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 max(20px, calc((100vw - 1160px) / 2));
    background: #ffffff;
    border-bottom: 1px solid #dce6e0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #17211f;
    text-decoration: none;
}

.brand span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: #124e4a;
    color: #fff;
    font-weight: 900;
}

.topbar nav {
    display: flex;
    gap: 16px;
    font-weight: 750;
}

.guest-main {
    width: min(1160px, calc(100% - 36px));
    margin: 0 auto;
    padding: 42px 0 76px;
}

.login-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: stretch;
}

.portal-hero,
.auth-card,
.card,
.metric {
    background: #ffffff;
    border: 1px solid #dbe5df;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(32, 49, 45, 0.08);
}

.portal-hero {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(28px, 5vw, 56px);
    color: #f7fffc;
    background:
        linear-gradient(rgba(13, 50, 48, 0.62), rgba(13, 50, 48, 0.84)),
        url("https://images.unsplash.com/photo-1576091160550-2173dba999ef?auto=format&fit=crop&w=1400&q=80") center / cover;
}

.portal-hero h1 {
    max-width: 760px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.02;
}

.portal-hero p {
    max-width: 620px;
    font-size: 18px;
}

.auth-card,
.card {
    padding: 24px;
}

.auth-card {
    align-self: start;
}

.auth-card h2,
.page-header h2,
.card h3,
.sidebar h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.narrow {
    max-width: 620px;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 22px;
    background: #123936;
    color: #eaf6f2;
}

.sidebar p {
    color: rgba(234, 246, 242, 0.76);
}

.nav {
    display: grid;
    gap: 8px;
}

.nav-group {
    display: grid;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.nav-label {
    padding: 4px 2px 0;
    color: rgba(234, 246, 242, 0.68);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav a,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #11645f;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.nav a {
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.09);
    color: #effaf6;
}

.button.secondary {
    background: #eef5f2;
    border-color: #cddbd5;
    color: #174743;
}

.button.danger {
    background: #9f2f2f;
    border-color: #9f2f2f;
    color: #fff;
}

.button.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.main {
    display: grid;
    gap: 22px;
    align-content: start;
    padding: 28px;
}

.page-header,
.section-title,
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.form-actions {
    position: sticky;
    bottom: 12px;
    justify-content: flex-end;
    padding: 12px;
    background: rgba(244, 247, 245, 0.92);
    border: 1px solid #dbe5df;
    border-radius: 8px;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    font-weight: 850;
    opacity: 0.7;
}

.muted {
    color: #60706b;
}

.stack,
.portfolio-form {
    display: grid;
    gap: 16px;
}

.grid {
    display: grid;
    gap: 18px;
}

.admin-grid {
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.metric {
    padding: 22px;
}

.metric span {
    display: block;
    font-size: 40px;
    font-weight: 900;
    color: #0e5c58;
}

.user-card,
.chip {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    padding: 10px 12px;
}

.user-card {
    margin-top: auto;
    display: grid;
    gap: 2px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    background: #e8f2ef;
    color: #174743;
    font-size: 12px;
    font-weight: 850;
}

label {
    display: grid;
    gap: 7px;
    font-size: 14px;
    font-weight: 750;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #c8d6d0;
    border-radius: 7px;
    background: #fff;
    color: #17211f;
    font: inherit;
}

input[readonly],
select:disabled {
    background: #f1f5f3;
    color: #586b66;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #dbe5df;
    text-align: left;
    vertical-align: top;
}

th {
    background: #edf5f2;
    color: #174743;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.actions,
.inline-form,
.contact-form {
    display: grid;
    gap: 8px;
}

.inline-form {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    align-items: end;
}

.reset-form {
    grid-template-columns: minmax(150px, 1fr) auto;
}

.contact-form {
    min-width: 220px;
}

.student-switcher {
    min-width: 280px;
}

.entry-year-form {
    display: grid;
    gap: 14px;
}

.resident-year-tab {
    border: 1px solid #dbe5df;
    border-radius: 8px;
    background: #fbfdfc;
    overflow: hidden;
}

.resident-year-tab + .resident-year-tab {
    margin-top: 12px;
}

.resident-year-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #eef6f2;
    color: #173f3a;
    font-weight: 800;
}

.year-tab-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #173f3a;
    min-width: 0;
}

.year-tab-arrow {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #1f6b5b;
    color: #fff;
    font-size: 13px;
    line-height: 1;
}

.year-tab-title span:last-child {
    font-size: 17px;
}

.year-tab-note {
    margin: 12px 16px 0;
}

.resident-year-tab .table-wrap {
    margin: 12px 16px 16px;
}

.year-entry-input {
    max-width: 120px;
    min-width: 100px;
}

.activity-list {
    display: grid;
    gap: 10px;
}

.activity-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) repeat(auto-fit, minmax(170px, 0.7fr));
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #dbe5df;
    border-radius: 8px;
    background: #fbfdfc;
}

.activity-row small {
    display: block;
    margin-top: 4px;
    color: #6b7874;
}

.flash {
    padding: 12px 14px;
    border-radius: 7px;
    border: 1px solid #c7d8d2;
    background: #edf7f2;
    color: #174743;
    font-weight: 750;
}

.flash-error {
    border-color: #e6c7c7;
    background: #fff0f0;
    color: #842727;
}

@media (max-width: 960px) {
    .login-grid,
    .shell,
    .admin-grid,
    .stats {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .activity-row,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .page-header,
    .section-title,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
.profile-heading{display:flex;align-items:center;gap:14px}.profile-photo{width:58px;height:70px;max-width:58px;max-height:70px;flex:0 0 58px;object-fit:cover;border-radius:9px;border:1px solid #cfded8;background:#eaf4ef}.profile-photo-placeholder{display:flex;align-items:center;justify-content:center;color:#176b63;font-size:24px;font-weight:900}.profile-heading h2{margin:0 0 8px}.locked-chip{background:#f8e5e2!important;color:#8d2d24!important}.profile-controls{display:flex;justify-content:space-between;align-items:flex-start;gap:24px}.profile-controls h3{margin-top:0}.profile-control-actions{display:flex;align-items:flex-end;justify-content:flex-end;gap:12px;flex-wrap:wrap}.photo-upload-form{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}.photo-upload-form label{min-width:280px}.photo-upload-form input[type=file]{padding:9px;background:#fff}
.particulars-photo-cell{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap}.particulars-photo-cell label{min-width:280px}.particulars-photo-cell input[type=file]{padding:9px;background:#fff}
@media (max-width:760px){.profile-controls{display:block}.profile-control-actions{justify-content:flex-start;margin-top:16px}.profile-heading{align-items:flex-start}.profile-photo{width:52px;height:62px;max-width:52px;max-height:62px;flex-basis:52px}}
