/* --- Token Matrix System Matrix --- */
:root {
    --bg-base: #ffffff;
    --bg-surface: #f8fafc;
    --bg-element: #f1f5f9;
    --text-core: #0f172a;
    --text-muted: #475569;
    --primary-brand: #d97706;
    --primary-hover: #b45309;
    --secondary-brand: #1e293b;
    --secondary-hover: #0f172a;
    --border-line: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --font-body: 'Inter', sans-serif;
    --font-title: 'Poppins', sans-serif;
}

[data-theme="dark"] {
    --bg-base: #0f172a;
    --bg-surface: #1e293b;
    --bg-element: #334155;
    --text-core: #f8fafc;
    --text-muted: #cbd5e1;
    --border-line: #334155;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* --- Base Formats --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-core);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--text-core);
}

a {
    text-decoration: none;
    color: inherit;
}

hr {
    border: none;
    border-top: 1px solid var(--border-line);
    margin: 15px 0;
}

/* Enforce precise structural scroll anchors offset safety layout limits */
section {
    scroll-margin-top: 110px;
}

/* --- App Header Layout --- */
.app-header {
    background-color: var(--bg-base);
    border-bottom: 1px solid var(--border-line);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary-brand);
}

.logo-text h1 {
    font-size: 1.25rem;
    line-height: 1.1;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 0;
    position: relative;
    transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-brand);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-brand);
    transition: var(--transition-smooth);
}

.nav-link.active::after,
.nav-link:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-core);
    cursor: pointer;
    padding: 6px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hamburger .bar {
    width: 22px;
    height: 2px;
    background-color: var(--text-core);
    transition: var(--transition-smooth);
}

/* --- Modern Search Banner System --- */
.search-banner {
    background: linear-gradient(135deg, var(--secondary-brand) 0%, #0f172a 100%);
    padding: 40px 24px;
    text-align: center;
    border-bottom: 4px solid var(--primary-brand);
}

.search-inner-wrap {
    max-width: 720px;
    margin: 0 auto;
}

.search-inner-wrap h2 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-bar-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

#globalSearchInput {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    outline: none;
    background-color: #ffffff;
    color: #000000;
}

/* --- High-Density Layout Architecture (Stabilized Columns Matrix) --- */
.dashboard-layout {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    /* Rigid column threshold allocation limits */
    gap: 32px;
}

.dashboard-sidebar {
    width: 280px;
    min-width: 280px;
}

.sidebar-sticky-wrap {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-sticky-wrap h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.sidebar-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.sidebar-links a:hover,
.sidebar-links a.active {
    background-color: var(--bg-surface);
    color: var(--primary-brand);
}

.sidebar-notice-board {
    background-color: var(--bg-surface);
    border-left: 4px solid var(--primary-brand);
    padding: 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.85rem;
}

.sidebar-notice-board h4 {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.dashboard-content-space {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}

.content-block-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--card-shadow);
    transition: transform 0.25s, opacity 0.25s;
}

.block-header {
    margin-bottom: 20px;
}

.block-header h3 {
    font-size: 1.4rem;
}

.block-sub-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.high-density-text {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- Internal Component Layout Formats --- */
.tagline-callout-box {
    background-color: var(--bg-element);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 20px;
    text-align: center;
    border: 1px dashed var(--border-line);
}

.tagline-callout-box h4 {
    font-size: 1.05rem;
    color: var(--primary-brand);
    margin-bottom: 6px;
}

.tagline-callout-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.about-tabs-container {
    border: 1px solid var(--border-line);
    background-color: var(--bg-base);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background-color: var(--bg-element);
    border-bottom: 1px solid var(--border-line);
    overflow-x: auto;
}

.tab-btn {
    padding: 14px 20px;
    border: none;
    background: transparent;
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background-color: var(--bg-base);
    color: var(--primary-brand);
    border-bottom: 2px solid var(--primary-brand);
}

.tabs-body {
    padding: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFade 0.3s ease;
}

@keyframes tabFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.feature-bullet {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
}

.check-icon {
    color: var(--primary-brand);
    margin-right: 4px;
}

.dense-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.data-row-card {
    background-color: var(--bg-base);
    border: 1px solid var(--border-line);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.data-row-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-brand);
}

.data-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.tag-alert {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.tag-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.tag-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.faculty-dense-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 15px;
}

.faculty-list-item {
    background-color: var(--bg-base);
    border: 1px solid var(--border-line);
    border-radius: var(--radius-md);
    padding: 18px;
}

.fac-meta {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.fac-icon-box {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background-color: rgba(217, 119, 6, 0.1);
    color: var(--primary-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.fac-meta h4 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.fac-meta p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sub-section-heading {
    font-size: 1.1rem;
    margin: 20px 0 10px;
    color: var(--text-core);
    border-left: 3px solid var(--primary-brand);
    padding-left: 10px;
}

.table-responsive-wrapper {
    overflow-x: auto;
    width: 100%;
    border: 1px solid var(--border-line);
    border-radius: var(--radius-md);
}

.dense-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
    background-color: var(--bg-base);
}

.dense-data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-line);
    color: var(--text-muted);
    font-weight: 500;
}

.contact-card-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-line);
    background-color: var(--bg-base);
}

.contact-info-panel {
    background-color: var(--secondary-brand);
    color: #ffffff;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-info-panel h4 {
    color: #ffffff;
}

.info-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.info-item i {
    color: var(--primary-brand);
    font-size: 1.2rem;
    margin-top: 4px;
}

.info-item h5 {
    color: #ffffff;
    font-size: 0.95rem;
}

.info-item p {
    color: #94a3b8;
    font-size: 0.85rem;
}

.contact-form-panel {
    padding: 32px;
}

/* --- Action Buttons & Forms System --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.btn-primary {
    background-color: var(--primary-brand);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline-dark {
    background: transparent;
    border-color: var(--border-line);
    color: var(--text-core);
}

.btn-outline-dark:hover {
    background-color: var(--bg-element);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.badge {
    background: rgba(217, 119, 6, 0.1);
    color: var(--primary-brand);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 50px;
    display: inline-block;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-line);
    background: var(--bg-surface);
    color: var(--text-core);
    border-radius: var(--radius-sm);
    font-family: inherit;
    outline: none;
    font-size: 0.85rem;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-brand);
    background: var(--bg-base);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* --- Modals Overlay Interface Layer --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background-color: var(--bg-base);
    border-radius: var(--radius-lg);
    box-shadow: var(--hover-shadow);
    width: 90%;
    max-width: 480px;
    padding: 32px;
    position: relative;
    transform: scale(0.9);
    display: none;
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-window.active {
    transform: scale(1);
    display: block;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* --- App Footer Layout --- */
.app-footer {
    background-color: var(--secondary-brand);
    color: #cbd5e1;
    padding: 24px;
    text-align: center;
    border-top: 4px solid var(--primary-brand);
    position: relative;
    z-index: 10;
}

.footer-bottom {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* --- Adaptive Viewport Breakpoints --- */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        /* Switch safely to single-row grid mapping rules */
    }

    .dashboard-sidebar {
        width: 100%;
        min-width: 100%;
    }

    .sidebar-sticky-wrap {
        position: static;
    }

    .sidebar-links {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .contact-card-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 69px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 69px);
        background-color: var(--bg-base);
        flex-direction: column;
        align-items: flex-start;
        padding: 40px;
        gap: 24px;
        transition: left 0.3s ease;
        border-top: 1px solid var(--border-line);
        box-shadow: var(--hover-shadow);
    }

    .nav-menu.active {
        left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}