:root {
    --primary: #528ECE;
    --primary-dark: #3D6FA3;
    --primary-light: #E8F1FA;
    --secondary: #059669;
    --accent: #528ECE;
    --bg-body: #F3F4F6;
    --bg-surface: #FFFFFF;
    --bg-primary: #FFFFFF;
    --bg-hover: #F9FAFB;
    --text-main: #1F2937;
    --text-secondary: #6B7280;
    --text-primary: #111827;
    --border: #E5E7EB;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-cap: 999px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Global Animated Auto-hiding Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

*:hover {
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
    transition: background 0.3s ease;
}

*:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #6AA3D9;
    --primary-dark: #528ECE;
    --primary-light: #1E3A5F;
    --bg-body: #111827;
    --bg-surface: #1F2937;
    --bg-primary: #1F2937;
    --bg-hover: #374151;
    --text-main: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-primary: #F9FAFB;
    --border: #374151;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #374151;
    border-color: #4B5563;
    color: var(--text-main);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    background: #1F2937;
}

[data-theme="dark"] .dialog-content {
    background: #1F2937;
}

[data-theme="dark"] .dialog-body {
    background: #111827;
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .event-card,
[data-theme="dark"] .idea-card,
[data-theme="dark"] .announcement-card {
    background: #374151;
    border-color: #4B5563;
}

[data-theme="dark"] th {
    background: #1F2937;
}

[data-theme="dark"] td {
    background: #1F2937;
    border-color: #374151;
}

[data-theme="dark"] tr:hover td {
    background: #374151;
}

[data-theme="dark"] .chip {
    background: #374151;
    border-color: #4B5563;
}

[data-theme="dark"] .login-card {
    background: transparent;
}

[data-theme="dark"] .btn-cancel {
    background: #374151;
    color: var(--text-main);
}

[data-theme="dark"] .toast {
    background: #374151;
}

/* Theme Toggle */
.theme-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-surface);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-weight: 500;
}

.theme-toggle-label svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.theme-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle.active {
    background: var(--primary);
}

.theme-toggle.active::after {
    transform: translateX(24px);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    /* Use dynamic viewport units if available for better mobile support */
    height: 100dvh;
    overflow: hidden;
    display: flex;
}

/* Logo */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.logo-container.small {
    margin-bottom: 8px;
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-container.small .logo-text {
    font-size: 1.75rem;
}

.logo-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

/* Auth */
#auth.login-only {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.authed #auth {
    display: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-logo {
    height: 100px;
    width: auto;
    animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Split Login Layout */
.login-split {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Left Panel - Branding */
.login-left {
    flex: 1;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    display: none;
}

.login-left::after {
    display: none;
}

.login-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 1;
    padding: 48px;
}

.login-logo {
    height: clamp(140px, 22vh, 260px);
    width: auto;
    margin-bottom: 32px;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.15));
}

.login-brand-text h1 {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.login-brand-text p {
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    color: var(--text-secondary);
    margin: 0 0 20px;
    font-weight: 400;
}

.login-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: var(--radius-cap);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid var(--border);
}

/* Right Panel - Form */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #528ECE 0%, #3D6FA3 40%, #2a5280 100%);
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.login-right::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    top: -150px;
    right: -100px;
}

.login-right::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    bottom: -100px;
    left: -80px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: left;
    z-index: 1;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.login-card h2 {
    margin: 0 0 4px;
    font-size: 1.6rem;
    color: white;
    font-weight: 700;
}

.login-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 28px;
}

/* Input with Icon */
.login-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-cap);
    padding: 0 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input-group:focus-within {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Override browser autofill styles */
.login-input-group input:-webkit-autofill,
.login-input-group input:-webkit-autofill:hover,
.login-input-group input:-webkit-autofill:focus,
.login-input-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: white;
    background-clip: text !important;
}

.login-input-group svg {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    transition: color 0.2s;
}

.login-input-group:focus-within svg {
    color: white;
}

.login-input-group input {
    border: none;
    background: transparent;
    padding: 14px 12px;
    flex: 1;
    font-size: 0.95rem;
    outline: none;
    color: white;
}

.login-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.login-input-group input:focus {
    background: transparent;
    border: none;
}

.login-card #loginBtn {
    width: 100%;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-top: 8px;
    background: white;
    border: none;
    border-radius: var(--radius-cap);
    color: var(--primary-dark);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.login-card #loginBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.login-card #loginBtn:active {
    transform: translateY(0);
}

.login-card .helper {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #EF4444;
    text-align: center;
}

/* Dark mode adjustments for login */
[data-theme="dark"] .login-left {
    background: #111827;
}

[data-theme="dark"] .login-brand-text h1 {
    color: #F9FAFB;
}

[data-theme="dark"] .login-brand-text p {
    color: #9CA3AF;
}

[data-theme="dark"] .login-badge {
    background: #1E3A5F;
    color: #6AA3D9;
    border-color: #374151;
}

/* App Layout */
.app-layout {
    display: none;
    width: 100%;
    height: 100%;
    padding: 10px;
    gap: 10px;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr;
}

body.authed .app-layout {
    display: grid;
}

/* Global Header - spans full width at the top */
.global-header {
    grid-column: 1 / -1;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 52px;
    margin: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.header-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-dept-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-right {
    flex-shrink: 0;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-dropdown .user-avatar {
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.profile-dropdown:hover .user-avatar {
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: scale(1.05);
}

.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 1000;
}

.profile-dropdown:hover .profile-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-info {
    padding: 12px 16px;
}

.dropdown-user-name {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.dropdown-user-role {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dropdown-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.dropdown-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: #EF4444;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.dropdown-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Top-Level Portal Tabs */
.portal-top-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    flex-shrink: 0;
}

.portal-top-tab {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: var(--bg-body);
    border-radius: var(--radius-cap);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    outline: none;
}

.portal-top-tab:hover {
    color: var(--primary);
    outline: 2px solid var(--primary);
}

.portal-top-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(82, 142, 206, 0.3);
}

.portal-top-tab.active:hover {
    outline: none;
    background: var(--primary-dark);
}

/* My Profile Cards */
.portal-top-view {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Form Builder Container Cards */
.container-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    overflow: hidden;
}

.container-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.container-card-header h4 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.container-card-header .container-toggle {
    transition: transform 0.2s;
}

.container-card-header .container-toggle.collapsed {
    transform: rotate(-90deg);
}

.container-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.container-card-body.collapsed {
    display: none;
}

.container-card-body.drag-over-empty {
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-md);
    min-height: 60px;
}

.field-card-wrapper .field-type-chip.selected {
    background: var(--primary);
    color: white;
}

.field-card-wrapper .field-type-chip {
    cursor: pointer;
    transition: all 0.15s;
}

.field-card-wrapper .field-type-chip:hover {
    background: var(--primary);
    color: white;
}

.container-add-field-btn {
    appearance: none;
    border: 2px dashed var(--border);
    background: none;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.container-add-field-btn:hover {
    border-color: var(--primary);
    background: rgba(82, 142, 206, 0.05);
}

/* Field Palette Panel */
.field-palette {
    position: sticky;
    top: 0;
    width: 220px;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.field-palette-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.field-palette-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.field-palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    cursor: grab;
    transition: all 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.field-palette-item:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.06);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 59, 130, 246), 0.15);
}

.field-palette-item:active {
    cursor: grabbing;
    transform: scale(0.96);
}

.field-palette-item svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.field-palette-item span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

.field-palette-item.hidden {
    display: none;
}

/* Form container sections in report view */
.form-container-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.form-container-section-header {
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.form-container-section-body {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

/* Default full-width for fields without layout */
.form-container-section-body>* {
    grid-column: 1 / span 12;
    min-width: 0;
    overflow: hidden;
}

/* ===== VISUAL LAYOUT EDITOR ===== */
.layout-editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.layout-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.layout-editor-toolbar h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.layout-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.layout-container-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    overflow: hidden;
    background: var(--card-bg);
}

.layout-container-header {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.layout-grid-area {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
    padding: 20px;
    min-height: 80px;
}

/* Light column guide lines */
.layout-grid-area::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(to right,
            transparent,
            transparent calc(100% / 12 - 1px),
            var(--border) calc(100% / 12 - 1px),
            var(--border) calc(100% / 12));
    opacity: 0.35;
    z-index: 0;
}

.layout-grid-item {
    position: relative;
    z-index: 1;
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: white;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    transition: box-shadow 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    margin: 4px;
}

.layout-grid-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.layout-grid-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.layout-grid-item .layout-field-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layout-grid-item .layout-field-chip {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.layout-grid-item .layout-col-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-secondary);
    white-space: nowrap;
}

.layout-resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    background: transparent;
    z-index: 5;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.layout-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.15s;
}

.layout-grid-item:hover .layout-resize-handle::after,
.layout-resize-handle:hover::after {
    opacity: 1;
}

.layout-drop-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
    z-index: 10;
    pointer-events: none;
    transition: left 0.1s;
}


.profile-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 900px;
}

.profile-info-card {
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-light), transparent);
    border-bottom: 1px solid var(--border);
}

.profile-card-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-card-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.profile-field-value {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Sidebar Department Dropdown */
.sidebar-dept-dropdown {
    margin-bottom: 8px;
}

.sidebar-dept-toggle {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vh, 12px);
    width: 100%;
    padding: clamp(8px, 1.6vh, 14px) 20px;
    border: none;
    background: transparent;
    border-radius: var(--radius-cap);
    font-size: clamp(0.85rem, 1.4vh, 0.95rem);
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    outline: none;
}

.sidebar-dept-toggle:hover {
    background: var(--bg-body);
    color: var(--primary);
    outline: 2px solid var(--primary);
}

.sidebar-dept-toggle .chevron {
    margin-left: auto;
    transition: transform 0.2s;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-dept-dropdown.expanded .chevron {
    transform: rotate(180deg);
}

.sidebar-dept-dropdown.expanded .sidebar-dept-toggle {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(82, 142, 206, 0.3);
}

.sidebar-dept-dropdown.expanded .sidebar-dept-toggle:hover {
    outline: none;
    background: var(--primary-dark);
}

.sidebar-dept-items {
    display: none;
    padding-left: 0;
    margin-top: 4px;
}

.sidebar-dept-dropdown.expanded .sidebar-dept-items {
    display: block;
}

.sidebar-dept-item {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vh, 12px);
    width: 100%;
    padding: clamp(8px, 1.6vh, 14px) 20px;
    border: none;
    background: transparent;
    border-radius: var(--radius-cap);
    font-size: clamp(0.85rem, 1.4vh, 0.95rem);
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    outline: none;
}

.sidebar-dept-item:hover {
    background: var(--bg-body);
    color: var(--primary);
    outline: 2px solid var(--primary);
}

.sidebar-dept-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(82, 142, 206, 0.3);
}

.sidebar-dept-item.active:hover {
    outline: none;
    background: var(--primary-dark);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    padding: clamp(12px, 3vh, 24px);
    min-height: 0;
    overflow: auto;
}

.sidebar-header {
    margin-bottom: clamp(16px, 4vh, 32px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 8px 0 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1vh, 8px);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 4px;
}

/* Hide nav items until permissions are applied (prevents flash for special access users) */
.sidebar-nav .nav-capsule {
    display: none;
}

body.permissions-ready .sidebar-nav .nav-capsule {
    display: flex;
}

/* Portal button is hidden by default - only shown by JS for special access users */
body.permissions-ready .sidebar-nav #nav_user_portal {
    display: none;
}

/* Show portal button when active class is added */
body.permissions-ready .sidebar-nav #nav_user_portal.portal-active {
    display: flex !important;
}

/* Hide ALL content sections until permissions are resolved (prevents flash of wrong content) */
body:not(.permissions-ready) .content-container>section,
body:not(.permissions-ready) #portal_manage_view,
body:not(.permissions-ready) #special_welcome {
    display: none !important;
}

/* Hide dynamic portal buttons for admin users - only shown for special access users */
.portal-btn-dynamic {
    display: none;
}

/* Flyout menu items should always be visible when permissions are ready */
body.permissions-ready .nav-dropdown-menu .nav-capsule {
    display: flex;
}

.nav-capsule {
    appearance: none;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vh, 12px);
    padding: clamp(8px, 1.6vh, 14px) 20px;
    border-radius: var(--radius-cap);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: clamp(0.85rem, 1.4vh, 0.95rem);
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-align: left;
    outline: none;
}

.nav-capsule:hover {
    background: var(--bg-body);
    color: var(--primary);
    outline: 2px solid var(--primary);
}

.nav-capsule.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(82, 142, 206, 0.3);
}

.nav-capsule.active:hover {
    outline: none;
    background: var(--primary-dark);
}

.nav-capsule svg {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

/* Nav Dropdown */
.nav-dropdown {
    display: flex;
    flex-direction: column;
    position: relative;
}

.nav-dropdown-toggle {
    justify-content: flex-start;
    position: relative;
}

.nav-dropdown-toggle .nav-label {
    flex: 1;
}

.dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-body);
    margin-left: auto;
    transition: transform 0.25s ease, background 0.2s;
}

.dropdown-arrow svg {
    width: 14px;
    height: 14px;
}

/* Split Button Layout */
.nav-split-button {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.nav-split-main {
    flex: 1;
    border-radius: var(--radius-cap) 0 0 var(--radius-cap);
    padding-right: 8px;
}

.nav-dropdown-arrow-btn {
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 0 var(--radius-cap) var(--radius-cap) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nav-dropdown-arrow-btn:hover {
    background: var(--bg-body);
}

.nav-dropdown-arrow-btn:hover .dropdown-arrow {
    background: var(--primary);
}

.nav-dropdown-arrow-btn:hover .dropdown-arrow svg {
    stroke: white;
}

.nav-dropdown.expanded .dropdown-arrow {
    transform: rotate(180deg);
    background: var(--primary);
}

.nav-dropdown.expanded .dropdown-arrow svg {
    stroke: white;
}

.nav-dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 8px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
}

.nav-dropdown.expanded .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.nav-submenu-item {
    font-size: 0.85rem;
    padding: 10px 16px;
    border-radius: var(--radius-cap);
    white-space: nowrap;
}

.nav-submenu-item:hover {
    border-left-color: var(--primary);
}

.nav-submenu-item.active {
    border-left-color: var(--primary);
}

.nav-submenu-item svg {
    width: 16px;
    height: 16px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: clamp(12px, 2.5vh, 24px);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Content */
.content-container {
    flex: 1;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(16px, 4vh, 32px);
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Tabs */
.tab.scrollable-tab {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tab.scrollable-tab.hidden {
    display: none !important;
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* UI Elements */
.hidden {
    display: none !important;
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-main);
}

h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

input,
select,
textarea {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-cap);
    font-size: 0.95rem;
    width: 100%;
    background: #F9FAFB;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font-family);
}

textarea {
    border-radius: var(--radius-md);
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background: white;
}

.input-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: block;
}

.select-input {
    padding: 12px 16px;
    border-radius: var(--radius-cap);
    border: 1px solid var(--border);
    background: white;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    appearance: auto;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-cap);
    padding: 8px 16px;
    transition: all 0.2s;
}

.chip:hover {
    background: #F3F4F6;
}

.chip input[type="checkbox"] {
    width: auto;
    margin: 0;
}

button {
    padding: 12px 24px;
    border-radius: var(--radius-cap);
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: var(--font-family);
}

button:hover {
    opacity: 0.9;
}

button.secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-main);
}

button.btn-cancel {
    background: #F3F4F6;
    color: var(--text-main);
}

button.btn-icon {
    padding: 8px 12px;
    background: transparent;
    color: var(--text-secondary);
}

button.btn-icon:hover {
    background: var(--bg-body);
    color: var(--primary);
}

/* Back Button */
.btn-back {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 50%;
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-back:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Tables */
.table-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.table-header-fixed table,
.scrollable-content table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th {
    text-align: left;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

td {
    padding: 16px;
    border-bottom: 1px solid #F3F4F6;
    color: var(--text-main);
    font-size: 0.95rem;
    background: white;
}

tr:hover td {
    background: #FAFAFA;
}

.btn-edit-icon,
.btn-delete-icon {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.btn-edit-icon:hover {
    background: #EEF2FF;
    color: var(--primary);
}

.btn-delete-icon:hover {
    background: #FEE2E2;
    color: #EF4444;
}

.btn-edit-icon svg,
.btn-delete-icon svg {
    width: 18px;
    height: 18px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(82, 142, 206, 0.15);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 4px 12px rgba(106, 163, 217, 0.25);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-icon.events {
    background: #EEF2FF;
    color: var(--primary);
}

.stat-icon.ideas {
    background: #FEF3C7;
    color: #D97706;
}

.stat-icon.members {
    background: #D1FAE5;
    color: #059669;
}

.stat-icon.announcements {
    background: #FEE2E2;
    color: #DC2626;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 999px;
    transition: all 0.2s;
    cursor: pointer;
    font-weight: 500;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-hover);
}

[data-theme="dark"] .quick-action-btn {
    background: #374151;
    border-color: #4B5563;
    color: var(--text-main);
}

[data-theme="dark"] .quick-action-btn:hover {
    background: #4B5563;
    border-color: var(--primary);
}

.quick-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-text {
    color: var(--text-secondary);
    font-style: italic;
}

/* Event Cards */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.event-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.event-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(82, 142, 206, 0.15);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.event-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.event-type-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-cap);
    background: #EEF2FF;
    color: var(--primary);
}

.linked-portal-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-cap);
    background: #D1FAE5;
    color: #059669;
}

.event-card-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-card-icons .btn-icon,
.event-card-icons .btn-delete-icon {
    padding: 6px;
    border-radius: 8px;
}

.event-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.event-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-meta-row svg {
    width: 16px;
    height: 16px;
}

.event-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--primary);
}

.event-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn-view-reports {
    font-size: 0.8rem;
    padding: 6px 12px;
    background: var(--primary) !important;
    color: white !important;
    border: none;
    border-radius: var(--radius-cap);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-reports:hover {
    background: var(--primary-hover) !important;
    transform: scale(1.02);
    color: white !important;
}

/* Report Cards */
.reports-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    color: #1f2937;
}

[data-theme="dark"] .report-card {
    background: #374151;
    color: #f9fafb;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.report-header strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.report-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.report-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.report-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-field {
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
}

.report-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
}

.report-value {
    color: var(--text-primary);
    word-break: break-word;
}

.report-card.clickable:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Report Detail Styles */
.report-detail-header {
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-detail-info {
    display: flex;
    gap: 8px;
}

.report-detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.report-detail-value {
    color: var(--text-primary);
}

.report-detail-field {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

[data-theme="dark"] .report-detail-field {
    background: #374151;
}

.report-field-value {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.report-link {
    display: block;
    color: var(--primary);
    text-decoration: none;
    padding: 6px 0;
}

.report-link:hover {
    text-decoration: underline;
}

.btn-delete-small {
    font-size: 0.85rem;
    padding: 8px 16px;
    background: white;
    color: var(--error);
    border: 1px solid var(--border);
    border-radius: var(--radius-cap);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.btn-delete-small:hover {
    background: #fee2e2;
    border-color: var(--error);
    color: #dc2626;
}

/* Submitted Report View */
.submitted-report-view {
    padding: 16px 0;
}

.submitted-report-header {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border-radius: var(--radius-md);
}

/* Ideas List */
.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.idea-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.idea-card:hover {
    border-color: var(--primary);
}

.idea-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.idea-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.idea-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-cap);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border: 2px solid #b9f6ca;
    border-radius: 50%;
    display: block;
}

.idea-status-badge.PENDING {
    background: #FEF3C7;
    color: #D97706;
}

.idea-status-badge.UNDER_REVIEW {
    background: #DBEAFE;
    color: #2563EB;
}

.idea-status-badge.APPROVED {
    background: #D1FAE5;
    color: #059669;
}

.idea-status-badge.REJECTED {
    background: #FEE2E2;
    color: #DC2626;
}

.idea-status-badge.INCUBATING {
    background: #EDE9FE;
    color: #7C3AED;
}

.idea-card-meta {
    display: flex;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.idea-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.idea-category {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-cap);
    background: #F3F4F6;
    color: var(--text-secondary);
}

/* Idea Detail */
.idea-detail h4 {
    font-size: 1.25rem;
    margin: 0 0 12px;
}

.idea-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.idea-section {
    margin-bottom: 16px;
}

.idea-section label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 4px;
}

.idea-section p {
    margin: 0;
    color: var(--text-main);
}

/* Announcements List */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.announcement-card:hover {
    border-color: var(--primary);
}

.announcement-card.pinned::before {
    content: '📌';
    position: absolute;
    top: -8px;
    right: 12px;
    font-size: 1.2rem;
}

.announcement-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.announcement-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.announcement-priority {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-cap);
}

.announcement-priority.LOW {
    background: #F3F4F6;
    color: #6B7280;
}

.announcement-priority.NORMAL {
    background: #DBEAFE;
    color: #2563EB;
}

.announcement-priority.HIGH {
    background: #FEF3C7;
    color: #D97706;
}

.announcement-priority.URGENT {
    background: #FEE2E2;
    color: #DC2626;
}

.announcement-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.announcement-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.announcement-targets {
    display: flex;
    gap: 6px;
}

.announcement-target-chip {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-cap);
    background: #F3F4F6;
}

/* Dialogs */
.dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 1;
    transition: opacity 0.2s;
}

.dialog.hidden {
    opacity: 0;
    pointer-events: none;
}

.dialog-content {
    background: #F3F4F6;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.3s;
}

.dialog.hidden .dialog-content {
    transform: scale(0.95);
}

.dialog-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    color: var(--text-secondary);
}

.close-icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.close-icon-btn svg {
    width: 20px;
    height: 20px;
}

.dialog-body {
    background: white;
    padding: 24px;
    border-radius: 20px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.dialog-body:hover {
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Attendance Table Overlap Fix */
#attendance_table_header, #attendance_table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

#attendance_table_header th, #attendance_table td {
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

#attendance_table td span {
  display: inline-block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.dialog-body::-webkit-scrollbar-track {
    background: transparent;
}

.dialog-body::-webkit-scrollbar-thumb {
  
<truncated 12273 bytes>

NOTE: The output was truncated because it was too long. Use a more targeted query or a smaller range to get the information you need