/* Shared visual theme. The existing style.css remains the functional base. */
:root {
    --maroon: #662534;
    --maroon-dark: #491b29;
    --gold: #d7b764;
    --ink: #28252a;
    --muted: #716d73;
    --line: #e5dfdd;
    --bg: #f6f4f1;
    --panel: #fff;
}

body { background: var(--bg); color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; }
a { color: var(--maroon); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}
button:hover, .btn:hover { background: var(--maroon-dark); }
.btn.light:hover { background: #e8e1df; color: var(--ink); }
.btn.danger:hover, button.danger:hover { background: #971f18; }

/* App frame and navigation */
.signed-in .app-shell { grid-template-columns: 256px minmax(0, 1fr); min-height: calc(100vh - 40px); }
.signed-in .sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 640px;
    padding: 24px 18px 22px;
    overflow-y: auto;
    background: var(--maroon-dark);
    border-right: 0;
    color: #f9f2f3;
}
.site-brand { display: flex; align-items: center; gap: 13px; min-width: 0; color: #fff; }
.site-brand:hover { color: #fff; }
.brand-mark {
    display: grid;
    flex: 0 0 49px;
    place-items: center;
    width: 49px;
    height: 49px;
    border: 1.5px solid var(--gold);
    border-radius: 13px;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: bold;
}
.brand-copy { display: grid; gap: 3px; min-width: 0; line-height: 1.2; }
.brand-copy strong { font-size: 15px; letter-spacing: .01em; }
.brand-copy small { color: #dfcdd0; font-size: 10px; font-weight: 600; letter-spacing: .045em; }
.sidebar .site-brand { margin: 0 8px 22px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.2); color: #fff; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar .nav-heading {
    margin: 23px 14px 7px;
    color: #d7b9bf;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .075em;
    text-transform: uppercase;
}
.sidebar .nav-heading:first-child { margin-top: 0; }
.sidebar nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 9px;
    color: #f2e7e9;
    font-size: 14px;
    transition: background .15s ease, color .15s ease;
}
.sidebar nav a::before {
    content: "";
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    margin-right: 13px;
    border: 1.5px solid var(--gold);
    border-radius: 50%;
}
.sidebar nav a { justify-content: flex-start; }
.sidebar nav a .message-unread-count { margin-left: auto; }
.sidebar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar nav a.active, .sidebar nav a.active:hover { background: #fff; color: var(--maroon-dark); font-weight: 700; }
.sidebar nav a.active::before { background: var(--maroon-dark); border-color: var(--maroon-dark); }
.sidebar-foot {
    margin: auto 8px 0;
    padding-top: 17px;
    border-top: 1px solid rgba(255,255,255,.2);
    color: #d7b9bf;
    font-size: 11px;
}
.signed-in .content { min-width: 0; padding: 0 42px 42px; }
.workspace-topbar {
    min-height: 72px;
    margin: 0 -42px 30px;
    padding: 13px 42px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}
.breadcrumb, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb strong { font-size: 13px; font-weight: 500; color: var(--ink); }
.topbar-actions { gap: 11px; }
.account-avatar {
    display: grid !important;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: #f1e4e6;
    color: var(--maroon-dark);
    font-size: 13px !important;
    font-weight: 700;
    opacity: 1 !important;
}
.account-name { min-width: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 13px !important; font-weight: 700; opacity: 1 !important; }
.workspace-topbar .logout-link {
    margin-left: 10px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--maroon-dark);
    font-size: 13px;
}
.workspace-topbar .logout-link:hover { background: #f8f1f2; }
.signed-in .footer { margin-left: 256px; background: var(--bg); }

/* Common page elements */
.page-header { margin-bottom: 22px; }
.page-header h1 { color: var(--maroon-dark); font-family: Georgia, serif; font-size: clamp(28px, 2.4vw, 36px); }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.panel, .stat { border-color: var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(39, 20, 24, .025); }
.panel { padding: 22px; }
.panel h2 { color: var(--maroon-dark); font-family: Georgia, serif; }
.stat { position: relative; padding: 20px; border-left: 1px solid var(--line); }
.stat::before { content: ""; display: block; width: 32px; height: 4px; margin-bottom: 16px; border-radius: 4px; background: var(--gold); }
.stat strong { color: var(--maroon-dark); font-family: Georgia, serif; font-size: 30px; }
.stat span { font-size: 13px; }
th { background: #faf8f6; color: #655d61; font-size: 12px; letter-spacing: .02em; }
th, td { border-bottom-color: var(--line); }
tr:last-child td { border-bottom: 0; }
input, select, textarea { border-color: #dcd5d2; border-radius: 7px; }
.badge { background: #f4eff0; color: var(--maroon-dark); }
.badge.done { background: #e8f4ed; color: #196b48; }
.message.mine { background: #f9edf0; border-color: #e5bdc6; }
.login-card { border-color: var(--line); border-top-color: var(--gold); border-radius: 13px; box-shadow: 0 14px 42px rgba(51, 19, 28, .08); }

/* Admin dashboard */
.dashboard-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 196px;
    margin-bottom: 30px;
    padding: 30px 38px;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(112deg, #4e1c2a, #793242);
    color: #fff;
}
.dashboard-hero-copy { position: relative; z-index: 1; max-width: 580px; }
.eyebrow { margin: 0 0 11px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.dashboard-hero h1 { margin-bottom: 12px; font-family: Georgia, serif; font-size: clamp(30px, 3vw, 42px); }
.dashboard-hero p:last-child { margin: 0; max-width: 530px; color: #f4e7e9; font-size: 14px; }
.hero-arches { position: absolute; right: -40px; bottom: -110px; width: 420px; height: 300px; opacity: .55; }
.hero-arches span { position: absolute; right: 0; bottom: 0; width: 240px; height: 290px; border: 1px solid #d79fa8; border-radius: 50% 50% 0 0; }
.hero-arches span:nth-child(2) { right: 65px; }
.hero-arches span:nth-child(3) { right: 130px; }
.hero-arches span:nth-child(4) { right: 195px; }
.dashboard-section { margin-bottom: 27px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; color: var(--maroon-dark); font-family: Georgia, serif; font-size: 23px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.dashboard-stats { gap: 20px; }
.dashboard-stats .stat { min-height: 126px; }
.dashboard-table-panel { padding: 0; overflow: hidden; }
.dashboard-table-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.dashboard-table-heading h3 { margin: 0; color: var(--maroon-dark); font-family: Georgia, serif; font-size: 19px; }
.dashboard-table-heading span { color: var(--muted); font-size: 12px; }
.dashboard-table-panel th, .dashboard-table-panel td { padding: 15px 22px; }
.dashboard-table-panel td strong { color: var(--maroon-dark); }
.rating-pill { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rating-good { background: #e8f3ec; color: #206c46; }
.rating-middle { background: #fff4d7; color: #8b5c00; }
.rating-low { background: #fae7e4; color: #a13225; }

/* Sign-in pages share the identity without adopting the dashboard shell. */
.guest-topbar { justify-content: center; min-height: 82px; background: var(--maroon-dark); border-bottom-color: var(--gold); }
.guest .guest-content { min-height: calc(100vh - 122px); }

@media (max-width: 1100px) {
    .signed-in .content { padding-right: 24px; padding-left: 24px; }
    .workspace-topbar { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .signed-in .app-shell { display: block; min-height: auto; }
    .signed-in .sidebar { position: static; height: auto; min-height: 0; padding: 16px 20px; }
    .sidebar .site-brand { margin-bottom: 10px; padding-bottom: 12px; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .sidebar .nav-heading, .sidebar-foot { display: none; }
    .sidebar nav a { min-height: 36px; padding: 7px 10px; white-space: nowrap; }
    .sidebar nav a::before { display: none; }
    .signed-in .footer { margin-left: 0; }
}
@media (max-width: 600px) {
    .signed-in .content { padding: 0 16px 28px; }
    .workspace-topbar { flex-direction: column; align-items: stretch; min-height: 62px; margin: 0 -16px 20px; padding: 9px 16px; }
    .breadcrumb span:first-child, .breadcrumb span:nth-child(2) { display: none; }
    .topbar-actions { width: 100%; min-width: 0; margin-left: 0; }
    .account-name { display: block; flex: 1; max-width: none; }
    .workspace-topbar .logout-link { margin-left: auto; white-space: nowrap; }
    .dashboard-hero { min-height: 180px; padding: 24px; }
    .hero-arches { right: -230px; }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dashboard-stats .stat { min-height: 105px; padding: 14px; }
    .dashboard-stats .stat strong { font-size: 25px; }
    .section-heading, .dashboard-table-heading { align-items: flex-start; flex-direction: column; }
    .dashboard-table-panel th, .dashboard-table-panel td { padding: 12px; }
}
@media (max-width: 420px) {
    .dashboard-stats { grid-template-columns: 1fr; }
}
@media print {
    .signed-in .app-shell { display: block; }
    .signed-in .content { padding: 0; }
    .dashboard-hero { color: #000; background: #fff; border: 1px solid #aaa; }
    .dashboard-hero p:last-child { color: #333; }
}

/* Faculty and Students page actions */
.sidebar a.site-brand,
.sidebar a.site-brand:hover,
.sidebar a.site-brand:focus-visible {
    color: #fff;
    background: transparent;
}
.sidebar .brand-copy strong { color: #fff; }

.page-header > .actions {
    gap: 10px;
    justify-content: flex-end;
    margin-top: 0;
}
.page-header > .actions > a[download$=".xlsx"],
.page-header > .actions > a.import-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    box-shadow: none;
}
.page-header > .actions > a[download$=".xlsx"] {
    border: 1px solid var(--maroon);
    background: #fff;
    color: var(--maroon);
}
.page-header > .actions > a[download$=".xlsx"]:hover {
    background: #f7eff1;
    color: var(--maroon-dark);
}
.page-header > .actions > a.import-action {
    border: 1px solid var(--maroon);
    background: var(--maroon);
    color: #fff;
}
.page-header > .actions > a.import-action:hover {
    border-color: var(--maroon-dark);
    background: var(--maroon-dark);
    color: #fff;
    box-shadow: none;
}

.table-wrap td:last-child { white-space: nowrap; }
.table-wrap button.danger {
    border: 1px solid #bf4a3e;
    background: #fff;
    color: #96291f;
}
.table-wrap button.danger:hover {
    border-color: #96291f;
    background: #fff2f0;
    color: #792118;
}

@media (max-width: 600px) {
    .page-header > .actions { justify-content: flex-start; }
    .page-header > .actions > a[download$=".xlsx"],
    .page-header > .actions > a.import-action { white-space: normal; }
}
