/* Main Layout */
:root {
    --content-height-offset: 140px;
}
.sidebar {
    width: 260px;
    min-width: 100px;
    max-width: 500px;
    background: #f4f4f4;
    color: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
    transition: background 0.3s, width 0.3s ease, margin-left 0.3s ease;
    border-right: 1px solid #ddd;
    position: relative;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right: none !important;
}

.sidebar.collapsed + #sidebar-resizer {
    display: none !important;
}

#sidebar-resizer {
    width: 5px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
    z-index: 100;
}

#sidebar-resizer:hover, #sidebar-resizer.resizing {
    background: var(--accent);
}

/* Sidebar Components */
.school-switcher {
    width: 100%;
    position: relative;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.active-school-display {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
}

.active-school-display:hover {
    background: #f8f9fa;
}

.active-school-logo {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.active-school-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.active-school-info {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
}

.active-school-name {
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--primary);
}

.school-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1100;
    max-height: 400px;
    overflow-y: auto;
}

.school-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.school-dropdown-item:hover {
    background: #f8f9fa;
}

.school-dropdown-item.active {
    background: #e3f2fd;
    font-weight: bold;
}

.school-dropdown-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.school-dropdown-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-nav-container {
    flex-grow: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.sidebar-nav a {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #444;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}

.sidebar-nav a:hover {
    background: #e9e9e9;
    color: var(--accent);
}

.sidebar-nav a.active {
    background: #fff;
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: bold;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-user-container {
    width: 100%;
    border-top: 1px solid var(--border-color);
    background: #fff;
    margin-top: auto;
    position: relative;
}

.user-profile-bar {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
    position: relative;
}

.user-profile-bar:hover {
    background: #f8f9fa;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.user-info {
    flex-grow: 1;
    overflow: hidden;
}

.user-name {
    font-weight: bold;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.user-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 6px rgba(0,0,0,0.1);
    z-index: 1100;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.2s;
    cursor: pointer;
}

.user-menu-item:hover {
    background: #f8f9fa;
    color: var(--accent);
}

/* Accordion */
.nav-accordion {
    width: 100%;
    border-bottom: 1px solid #eee;
}

.nav-accordion-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #444;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}

.nav-accordion-header:hover {
    background: #e9e9e9;
    color: var(--accent);
}

.nav-accordion-header i:first-child {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-accordion-header .chevron {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.nav-accordion.active .nav-accordion-header {
    background: #fff;
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: bold;
}

.nav-accordion.active .nav-accordion-header .chevron {
    transform: rotate(180deg);
}

.nav-accordion-content {
    background: #fcfcfc;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.nav-accordion.active .nav-accordion-content {
    max-height: 800px;
}

.nav-accordion-content a {
    padding: 0.75rem 1rem 0.75rem 3.5rem !important;
    font-size: 0.85rem;
    border-left: none !important;
    display: flex !important;
    align-items: center;
    gap: 1rem;
    color: #555 !important;
    text-decoration: none !important;
    width: 100%;
}

.nav-accordion-content a i {
    width: 16px !important;
    font-size: 0.9rem !important;
}

.nav-accordion-content a:hover, .nav-accordion-content a.active {
    background: #f0f0f0 !important;
    color: var(--accent) !important;
    font-weight: bold;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible; /* Allow admin menu dropdowns to be visible */
}

.topbar {
    height: 60px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    justify-content: space-between;
    width: 100%;
    color: var(--text-color);
    overflow: visible; /* Allow admin menu dropdowns to be visible */
    position: relative;
    z-index: 1000;
}

.nav-items {
    display: flex;
    gap: 1rem;
}

.nav-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    color: var(--primary);
    text-decoration: none;
}

.nav-item:hover {
    background: #eee;
}

.content {
    flex: 1;
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-title-container h1 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary);
    white-space: nowrap;
}

/* Announcement Header Styles */
#announcement-header-container {
    background: #fffdeb;
    border-bottom: 1px solid #ffeeba;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 46px; /* 60px Topbar + 46px = 106px, passend zur Sidebar-Header-Höhe */
}

.announcement-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
}

.announcement-text-single {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    overflow: hidden;
    font-size: 1.2rem;
}

.announcement-title {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 120px);
}

.more-link {
    font-size: 0.9rem;
    text-decoration: underline;
    font-weight: bold;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.announcement-wrapper:hover .more-link {
    color: var(--primary);
}

.hidden-mobile {
    display: block;
}

.show-mobile {
    display: none !important;
}

@media (max-width: 767px) {
    .hidden-mobile {
        display: none !important;
    }
    .show-mobile {
        display: block !important;
    }
}

.hamburger-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2c3e50; /* Explizite dunkle Farbe statt nur Variable */
    cursor: pointer;
    padding: 0.5rem;
}

#sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1500; /* Higher than topbar to darken it too */
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1600; /* Higher than backdrop */
        width: 260px !important;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-active {
        left: 0;
    }

    #sidebar-resizer {
        display: none;
    }

    .active-school-name {
        display: block;
    }

    .nav-item span {
        display: none;
    }

    .content {
        padding: 0.75rem 0.75rem 0.25rem 0.75rem;
    }
    :root {
        --content-height-offset: 80px;
    }
}

/* Mailbox Client Layout */
.mailbox-client {
    display: flex;
    height: calc(100vh - 160px);
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.mailbox-folders-pane {
    width: 250px;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

@media (max-width: 767px) {
    /* Verstecke die globale Topbar im Postfach-Modul auf Mobile */
    body.module-mailbox .topbar {
        display: none !important;
    }
    
    body.module-mailbox .content {
        padding-top: 0 !important;
    }

    .mailbox-folders-pane {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1200; /* Höher als das Backdrop */
        width: 280px !important;
        background: white;
        transform: translateX(-100%);
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        border-right: none;
    }
    
    .mailbox-folders-pane.active {
        transform: translateX(0);
    }

    #mailbox-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1150;
        display: none;
    }

    #mailbox-backdrop.active {
        display: block;
    }

    .mail-hamburger-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        color: #2c3e50 !important; /* Explizite dunkle Farbe */
    }

    /* Fallback für Firefox Klar / geblockte Webfonts */
    .fa-solid, .fas {
        font-weight: 900 !important;
        display: inline-block !important;
        min-width: 1em;
        text-align: center;
    }
}

.mailbox-folders-pane.collapsed {
    width: 0 !important;
    border-right: none !important;
}

.mailbox-folders-resizer {
    width: 4px;
    cursor: col-resize;
    background: #eee;
    transition: background 0.2s;
    z-index: 10;
    flex-shrink: 0;
}

.mailbox-folders-resizer:hover, .mailbox-folders-resizer.resizing {
    background: var(--accent);
}

.mailbox-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mailbox-panes-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.account-sidebar-section {
    border-bottom: 1px solid #e0e0e0;
}

.account-sidebar-header {
    padding: 0.8rem 1rem;
    font-weight: bold;
    font-size: 0.85rem;
    color: #444;
    background: #eceef1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-sidebar-header .btn-icon {
    color: #888;
    opacity: 0.6;
    transition: all 0.2s;
}

.account-sidebar-header .btn-icon:hover {
    color: var(--accent);
    opacity: 1;
    transform: rotate(30deg);
}

.account-folder-list {
    padding: 0.2rem 0;
}

.folder-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #555;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.folder-item:hover {
    background: #eee;
    color: var(--accent);
}

.folder-item.active {
    background: #fff;
    color: var(--accent);
    font-weight: bold;
    border-right: 3px solid var(--accent);
}

.folder-tree-node {
    display: flex;
    flex-direction: column;
}

.folder-children {
    margin-left: 1rem;
    border-left: 1px solid #ddd;
}

.folder-toggle {
    cursor: pointer;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.folder-toggle.collapsed {
    transform: rotate(-90deg);
}

.mailbox-list-pane {
    width: 350px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.mailbox-content-pane {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mailbox-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcfcfc;
}

.mail-list {
    flex: 1;
    overflow-y: auto;
}

.mail-item {
    padding: 1rem;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.mail-item:hover {
    background: #f9f9f9;
}

.mail-item.active {
    background: #eef6ff;
    border-left: 4px solid var(--accent);
}

.mail-item.unseen {
    background: #fff;
    font-weight: bold;
}

.mail-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: #666;
}

.mail-item-subject {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.mail-content-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ccc;
    text-align: center;
}

.mail-content-view {
    padding: 2rem;
}

.mail-view-header h2 {
    margin: 1rem 0 0.5rem 0;
}

.mail-meta {
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mail-body {
    margin-top: 2rem;
    line-height: 1.6;
    color: #444;
}

/* Mailbox Enhancements */
.mailbox-header select.form-control {
    font-size: 0.85rem;
    padding: 4px 8px;
    height: auto;
}

.special-search-box {
    background: #f8f9fa;
    border-color: #dee2e6 !important;
}

.search-results-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    background: white;
    border-radius: 4px;
}

.list-group-item {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #eee;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background: #f0f7ff;
}

.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

@media (max-width: 600px) {
    .grid-2-col, .grid-3-col { grid-template-columns: 1fr; }
}

.mailbox-client .folder-item i {
    width: 20px;
    text-align: center;
}

/* Modal and Utility */
.pointer { cursor: pointer; }
.margin-y-1 { margin-top: 1rem; margin-bottom: 1rem; }
.padding-1 { padding: 1rem; }
.rounded { border-radius: 4px; }
.border { border: 1px solid #ddd; }
.hidden { display: none !important; }

.search-dropdown ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.search-dropdown li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-dropdown li:hover {
    background: #f0f7ff;
}

/* Mobile Utilities */
.show-mobile { display: none; }

@media (max-width: 767px) {
    .mailbox-list-pane { width: 100%; }
    .hidden-mobile { display: none !important; }
    .show-mobile { display: block; }
    
    .mailbox-client { height: auto; min-height: 500px; }
    
    .mail-content-view { padding: 1rem; }
}

/* Buttons */
.btn-icon {
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
}

.btn-icon:hover { color: var(--accent); }

/* Calendar Styles */
.calendar-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calendar-item {
    display: flex;
    padding: 1rem;
    gap: 1.5rem;
    align-items: flex-start;
}

.calendar-item-date {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.date-day {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    line-height: 1;
}

.date-month {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #666;
    margin-top: 2px;
}

.calendar-item-info {
    flex: 1;
}

.calendar-item-summary {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.calendar-item-location {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.calendar-item-desc {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.4;
}

.appointment-preview-item {
    display: flex;
    gap: 0.8rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.appointment-date {
    font-weight: bold;
    color: var(--accent);
    min-width: 45px;
}

.appointment-summary {
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clickable { cursor: pointer; }
.clickable:hover { background: #f8f9fa; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
}

.modal-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    color: #999;
}

.modal-body {
    line-height: 1.6;
}

.modal-footer {
    margin-top: 2rem;
    text-align: right;
}


/* Settings & Password Change */
.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.margin-bottom-1 {
    margin-bottom: 1rem;
}

.margin-top-1 {
    margin-top: 1rem;
}

.input-group-password {
    position: relative;
    margin-bottom: 1rem;
    max-width: 300px;
}

.input-group-password input {
    width: 100%;
    padding: 10px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
}

.status-success {
    color: #28a745;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
    margin-top: 10px;
}

.status-error {
    color: #dc3545;
    padding: 10px;
    background: #f8d7da;
    border-radius: 4px;
    margin-top: 10px;
}

.sidebar-divider {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.sidebar-header-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    font-weight: bold;
    letter-spacing: 1px;
}

.sidebar-header-item i {
    width: 20px;
    text-align: center;
}

.sidebar-school-selector {
    padding: 0.5rem 0;
    width: 100%;
}

.school-selector-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    color: #444;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.school-selector-item:hover {
    background: #e9e9e9;
    color: var(--accent);
}

.school-selector-item.active {
    background: #fff;
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: bold;
}

.school-selector-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
    background: white;
    border: 1px solid #eee;
}

.school-selector-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.school-selector-code {
    font-size: 0.9rem;
    font-weight: bold;
    width: 40px;
}

.school-selector-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Admin Specific Sidebar & Menu Styles */
.admin-school-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
    text-decoration: none;
    color: var(--primary);
    transition: all 0.2s;
    width: 100%;
}

.admin-school-item:hover {
    background: rgba(0,0,0,0.05);
}

.admin-school-item.active {
    background: #fff;
    border-left: 4px solid var(--accent);
}

.school-selector-icon-large {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.school-selector-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.school-code-large {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Admin Menu Mode in Announcement Container */
#announcement-header-container.admin-menu-mode {
    padding: 0;
    height: auto;
    min-height: 46px;
    overflow: visible; /* CRITICAL: Must be visible for dropdowns */
    position: relative;
    z-index: 900;
}

.admin-menu-tree {
    display: flex;
    align-items: stretch;
    height: 100%;
    width: 100%;
    overflow: visible; /* Fix clipping of absolute dropdowns */
}

.admin-menu-item {
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    border-right: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
    color: #444;
    height: 46px;
    white-space: nowrap;
}

.admin-menu-item:hover {
    background: rgba(0,0,0,0.05);
    color: var(--accent);
}

.admin-menu-item i {
    font-size: 1.1rem;
}

/* Hierarchical Menu Styles */
.admin-menu-category {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 46px;
    cursor: pointer;
    border-right: 1px solid rgba(0,0,0,0.05);
    white-space: nowrap;
    font-size: 0.95rem;
    color: #444;
    transition: background 0.2s;
}

.admin-menu-category:hover {
    background: rgba(0,0,0,0.05);
    color: var(--accent);
}

.admin-menu-category i.fa-chevron-down {
    font-size: 0.7rem;
    margin-left: 0.5rem;
    opacity: 0.6;
}

.admin-menu-dropdown {
    display: none;
    position: absolute;
    top: 46px;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 2000;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

.admin-menu-category:hover .admin-menu-dropdown,
.admin-menu-category.active .admin-menu-dropdown {
    display: block;
}

.admin-menu-category.active {
    background: rgba(0,0,0,0.08);
    color: var(--accent);
}

.admin-menu-dropdown-item {
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.admin-menu-dropdown-item:last-child {
    border-bottom: none;
}

.admin-menu-dropdown-item:hover {
    background: #f8f9fa;
    color: var(--accent);
    padding-left: 1.75rem;
}

.admin-menu-dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* Adjustments for active school in admin mode */
.sidebar.admin-mode .active-school-container {
    flex-direction: row;
    padding: 1rem 1.5rem;
    justify-content: flex-start;
    gap: 1rem;
}

.sidebar.admin-mode .active-school-logo {
    width: 60px;
    height: 60px;
}

.sidebar.admin-mode .active-school-name {
    font-size: 1.1rem;
    margin-top: 0;
}
