:root {
    --primary-color: #1e6ba8;
    --secondary-color: #2a89d4;
    --success-color: #22c55e;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --accent-teal: #0d9488;
    --text-dark: #1a1a1a;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f1f5f9;
    --bg-white: #ffffff;
    --page-bg: #eef2f7;
    --box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    --box-shadow-card: 0 4px 24px rgba(15, 23, 42, 0.08);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: "Noto Sans Khmer", "Segoe UI", system-ui, sans-serif;
    background-color: var(--page-bg);
    color: var(--text-dark);
}

/* ========== LOGIN PAGE ========== */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-shell {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--box-shadow-card);
    padding: 2rem 2rem 1.75rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto 1rem;
    border-radius: var(--radius-sm);
    padding: 3px;
    background: #fff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.login-logo-img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.login-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.login-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.login-form .form-group {
    margin: 0;
}

.login-form .form-input {
    width: 100%;
    box-sizing: border-box;
}

.login-form .password-input-wrap {
    position: relative;
    width: 100%;
    display: block;
}

.login-form .password-input-wrap .form-input {
    width: 100%;
    padding-right: 2.75rem;
}

.login-form .password-input-wrap__toggle {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.login-form .password-input-wrap__toggle:hover {
    color: #475569;
    background: #f1f5f9;
}

.login-form .password-input-wrap__icon--hide[hidden],
.login-form .password-input-wrap__icon--show[hidden] {
    display: none;
}

.login-remember {
    margin: -0.35rem 0 0;
}

.login-remember__label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-light);
    cursor: pointer;
    user-select: none;
}

.login-remember__label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
    padding: 0.85rem 1rem;
}

.login-hint {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.5;
    text-align: center;
}

.login-switch {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9375rem;
    color: #475569;
}

.login-switch a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.login-switch a:hover {
    text-decoration: underline;
}

.login-form .form-hint {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.header-logout-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-logout-link:hover {
    background: #f0f7ff;
    border-color: #bfdbfe;
}

/* ========== HEADER ========== */
.header {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--box-shadow);
    padding: 0.9rem 1.35rem 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 300;
    overflow: visible;
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-page-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    line-height: 1.35;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.header-calendar-switch {
    flex-shrink: 0;
}

.header-calendar-select {
    max-width: 14rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 0.82rem;
    color: var(--text-dark);
    cursor: pointer;
}

.header-calendar-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.header-icon-btn {
    position: relative;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-icon-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.header-notify-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger-color);
    border: 2px solid var(--bg-white);
    box-sizing: content-box;
}

.header-notify-dot--hidden {
    display: none;
}

.header-notify-wrap {
    position: relative;
}

.header-notify-wrap.is-open {
    z-index: 400;
}

.notify-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 500;
    width: min(22rem, calc(100vw - 2rem));
    max-height: min(24rem, calc(100vh - 6rem));
    display: none;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.notify-dropdown[hidden] {
    display: none !important;
}

.notify-dropdown.is-open {
    display: flex !important;
}

.notify-dropdown__head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eef2f6;
    flex-shrink: 0;
}

.notify-dropdown__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
}

.notify-dropdown__state {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
}

.notify-dropdown__state--error {
    color: var(--danger-color);
}

.notify-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    overflow-y: auto;
    flex: 1;
}

.notify-dropdown__empty {
    margin: 0;
    padding: 1.25rem 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
}

.notify-item {
    display: block;
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: background-color 0.15s ease;
}

.notify-item:hover,
.notify-item:focus-visible {
    background: #f1f5f9;
    outline: none;
}

.notify-item:focus-visible {
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.notify-item__type {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.notify-item__title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.35;
    margin-bottom: 0.15rem;
}

.notify-item__body {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notify-item__time {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: #94a3b8;
}

.notify-item--unread .notify-item__title {
    font-weight: 700;
}

.notify-item--unread::before {
    content: '';
    position: absolute;
    left: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

.notify-item--unread {
    position: relative;
    padding-left: 1.1rem;
}

.notify-item--muted {
    opacity: 0.75;
}

.header-bell-icon {
    flex-shrink: 0;
}

.header-profile {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 0.35rem 0.75rem 0.35rem 0.4rem;
    border-radius: 999px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font: inherit;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-profile:hover {
    background-color: #fafbfc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
}

.header-profile:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.profile-chevron {
    color: var(--text-light);
    flex-shrink: 0;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-profile-wrap {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 200;
    min-width: 12.5rem;
    padding: 0.35rem;
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.profile-dropdown {
    display: none;
}

.profile-dropdown[hidden] {
    display: none !important;
}

.profile-dropdown.is-open {
    display: block !important;
}

.profile-menu__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.profile-menu__item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.profile-menu__item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.profile-menu__item svg {
    flex-shrink: 0;
    color: #64748b;
}

.profile-menu__item--danger,
.profile-menu__item--danger svg {
    color: #dc2626;
}

.profile-menu__item--danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.header-profile[aria-expanded="true"] .profile-chevron {
    transform: rotate(180deg);
}

.header-profile .profile-chevron {
    transition: transform 0.2s ease;
}

.app-placeholder-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--box-shadow-card);
    padding: 2rem 2.25rem;
    max-width: 36rem;
}

.app-placeholder-card__title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.app-placeholder-card__text {
    margin: 0 0 1.25rem;
    color: #64748b;
    line-height: 1.55;
}

/* ========== APP SHELL ========== */
.container-main {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 100vh;
    padding: 1.25rem;
    gap: 1.25rem;
    background-color: var(--page-bg);
}

.app-workspace {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    gap: 1rem;
}

.workspace-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 248px;
    flex-shrink: 0;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--box-shadow-card);
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.logo-ring {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-sm);
    padding: 3px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.logo-image {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--bg-white);
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 0.8rem 1rem;
    background-color: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-btn svg {
    flex-shrink: 0;
}

.nav-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.nav-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-white);
    box-shadow: 0 4px 14px rgba(30, 107, 168, 0.35);
}

.nav-btn--parent {
    justify-content: flex-start;
}

.nav-btn__chevron {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-group.is-open .nav-btn__chevron {
    transform: rotate(180deg);
}

.nav-group.is-open > .nav-btn--parent {
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.nav-submenu {
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.15rem 0 0.35rem 2.35rem;
}

.nav-group.is-open .nav-submenu {
    display: flex;
}

.nav-sub-btn {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-sub-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.nav-sub-btn.active {
    background-color: rgba(30, 107, 168, 0.12);
    color: var(--primary-color);
    font-weight: 600;
}

.event-type-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    vertical-align: middle;
    border: 1px solid var(--border-color);
}

.form-input--color {
    padding: 0.25rem;
    height: 2.5rem;
    width: 4rem;
}

.event-type-modal {
    max-width: 28rem;
}

.users-table__cell-actions .meetings-row-actions {
    justify-content: flex-end;
}

body.modal-open {
    overflow: hidden;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    align-self: stretch;
    overflow-y: auto;
    padding: 0.25rem 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.welcome-section {
    width: 100%;
    background-color: var(--bg-white);
    padding: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.welcome-section-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 1.5rem;
    padding: 1.5rem 1.75rem;
}

.welcome-content {
    flex: 1;
    min-width: min(100%, 18rem);
}

.welcome-title {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.28;
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    font-size: 0.94rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
    max-width: 42rem;
}

.welcome-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.btn-welcome-cta {
    padding: 0.8rem 1.45rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 18px rgba(30, 107, 168, 0.35);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-welcome-cta:hover {
    box-shadow: 0 8px 22px rgba(30, 107, 168, 0.42);
}

.btn-welcome-cta:active {
    box-shadow: 0 4px 12px rgba(30, 107, 168, 0.3);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem 1.35rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: background-color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: #154d7f;
}

/* ========== STATS SECTION ========== */
.stats-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.stats-panel__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    padding: 1rem 1.15rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.stats-panel__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.stats-panel__field-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
}

.stats-panel__select {
    min-width: 10.5rem;
}

.stats-panel__range {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.85rem;
}

.stats-panel__range[hidden] {
    display: none !important;
}

.stats-panel__date {
    min-width: 10.5rem;
}

.stats-panel__apply {
    flex-shrink: 0;
}

.stats-panel__apply[hidden] {
    display: none !important;
}

.stats-panel__period {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stats-section {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stats-section[aria-busy="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.stat-card {
    width: 100%;
    background-color: var(--bg-white);
    padding: 1.35rem 1.25rem 1.35rem 1.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    position: relative;
    text-align: left;
    min-height: 118px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    border-color: rgba(30, 107, 168, 0.18);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.stat-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.05;
    font-feature-settings: "lnum" 1;
}

.stat-number--khmer {
    font-size: 2.05rem;
    letter-spacing: 0.02em;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon--meetings {
    background: #e8f1fa;
    color: #1e6ba8;
}

.stat-icon--upcoming {
    background: #e8edf4;
    color: #2563eb;
}

.stat-icon--progress {
    background: #dcfce7;
    color: #16a34a;
}

.stat-icon--completed {
    background: #e8ecf1;
    color: #475569;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.45;
    max-width: 11rem;
}

/* ========== CONTENT WRAPPER: main column + reminders ========== */
.content-wrapper {
    display: grid;
    /* content-stack 7/12, right-sidebar 5/12 */
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 1.25rem;
    align-items: stretch;
    width: 100%;
    min-height: 0;
}

.content-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    min-height: 0;
    width: 100%;
}

.content-stack > .calendar-section,
.content-stack > .events-section {
    width: 100%;
    max-width: 100%;
}

/* ========== CALENDAR SECTION (detail UI) ========== */
.calendar-section {
    background-color: var(--bg-white);
    padding: 1.35rem 1.5rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-card);
}

.calendar-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.1rem;
}

.calendar-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.calendar-nav-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--primary-color);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.calendar-nav-btn:hover {
    background: #eef6fc;
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(30, 107, 168, 0.12);
}

.calendar-nav-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.calendar-header-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(145deg, #0a5c6e 0%, #0d7a8f 42%, #c9a227 88%, #e8bc4a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(10, 92, 110, 0.35);
}

.calendar-header-icon svg {
    flex-shrink: 0;
}

.calendar-month-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.35rem 0.15rem 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: background-color 0.15s ease;
}

.calendar-month-trigger:hover {
    background: #f1f5f9;
}

.calendar-month-trigger:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.calendar-month-trigger__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.calendar-month-kh {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.calendar-month-year {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.2;
}

.calendar-month-trigger__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.calendar-month-trigger__chevron svg {
    display: block;
}

/* Month / year picker popup */
.calendar-month-picker {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 6.5rem 1.25rem 1rem 1.75rem;
}

.calendar-month-picker.is-open {
    display: flex;
}

@media (max-width: 720px) {
    .calendar-month-picker.is-open {
        justify-content: center;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.calendar-month-picker__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(1px);
}

.calendar-month-picker__dialog {
    position: relative;
    z-index: 2;
    width: min(100%, 22rem);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    border: 1px solid #e8ecf0;
    padding: 1.1rem 1rem 0.85rem;
    pointer-events: auto;
}

.calendar-month-picker__title {
    margin: 0 0 0.85rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.calendar-month-picker__wheels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.calendar-picker-wheel {
    position: relative;
    height: 11rem;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        #000 18%,
        #000 82%,
        transparent 100%
    );
}

.calendar-picker-wheel::-webkit-scrollbar {
    display: none;
}

.calendar-picker-wheel::before {
    content: "";
    position: sticky;
    top: 50%;
    left: 0;
    right: 0;
    display: block;
    height: 0;
    margin-top: -1.375rem;
    margin-bottom: -1.375rem;
    pointer-events: none;
    z-index: 0;
}

.calendar-picker-wheel__list {
    list-style: none;
    margin: 0;
    padding: 4.3rem 0.35rem;
}

.calendar-picker-wheel__item {
    scroll-snap-align: center;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.1rem 0;
    padding: 0 0.5rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, font-size 0.15s ease;
    position: relative;
    z-index: 1;
}

.calendar-picker-wheel__item.is-active {
    background: #f1f5f9;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
}

.calendar-month-picker__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.25rem;
    padding: 0.35rem 0.25rem 0;
    border-top: 1px solid #f1f5f9;
}

.calendar-month-picker__btn {
    border: none;
    background: transparent;
    padding: 0.55rem 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.calendar-month-picker__btn--cancel {
    color: #64748b;
}

.calendar-month-picker__btn--cancel:hover {
    color: #334155;
}

.calendar-month-picker__btn--confirm {
    color: #2563eb;
}

.calendar-month-picker__btn--confirm:hover {
    color: #1d4ed8;
}

body.calendar-month-picker-open {
    overflow: hidden;
}

.calendar-header-lunar {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 14rem;
}

.calendar-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 0.15rem;
}

.calendar-summary-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calendar-summary-settings-btn:hover {
    background: #eef6fc;
    border-color: #93c5fd;
    color: var(--primary-color);
}

.calendar-summary-settings-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.calendar-summary-settings {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.calendar-summary-settings.is-open {
    display: flex;
}

.calendar-summary-settings__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.calendar-summary-settings__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 22rem);
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    padding: 1.15rem 1.25rem 1.25rem;
}

.calendar-summary-settings__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.calendar-summary-settings__hint {
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.calendar-summary-settings__fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.calendar-summary-settings__legend {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.45rem;
}

.calendar-summary-settings__option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0;
    font-size: 0.86rem;
    color: #1e293b;
    cursor: pointer;
}

.calendar-summary-settings__value-field {
    margin-top: 0.65rem;
}

.calendar-summary-settings__value-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.3rem;
}

.calendar-summary-settings__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 1rem;
}

.calendar-summary-settings__btn {
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.calendar-summary-settings__btn--cancel {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.calendar-summary-settings__btn--apply {
    background: var(--primary-color);
    color: #ffffff;
}

.calendar-summary-settings-btn.is-active {
    background: #eef6fc;
    border-color: #2563eb;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.calendar-past-days-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calendar-past-days-toggle:hover {
    background: #eef6fc;
    border-color: #93c5fd;
    color: var(--primary-color);
}

.calendar-past-days-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.calendar-past-days-toggle.is-active {
    background: #eef6fc;
    border-color: #2563eb;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.calendar-cell--past .calendar-cell-markers--counts {
    display: none;
}

.calendar-grid.calendar-grid--show-past-counts .calendar-cell--past .calendar-cell-markers--custom {
    display: none !important;
}

.calendar-grid.calendar-grid--show-past-counts .calendar-cell--past .calendar-cell-markers--counts {
    display: flex;
}

.calendar-lunar-line1,
.calendar-lunar-line2 {
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.35;
}

.calendar-lunar-line1 {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0.25rem 0.35rem;
}

.calendar-be-label {
    margin-right: 0.1rem;
}

.calendar-be-value {
    font-weight: 600;
    color: #475569;
    font-feature-settings: "lnum" 1;
}

.calendar-surface {
    border: 1px solid #dde4ed;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.weekday {
    font-size: 0.76rem;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
    padding: 0.55rem 0.25rem;
    border-right: 1px solid #eef2f6;
}

.weekday:last-child {
    border-right: none;
}

.weekday--sun {
    color: #dc2626;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.55rem 0.65rem 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.3;
}

.calendar-legend__sample--today {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: #0d9488;
    box-shadow: 0 1px 2px rgba(13, 148, 136, 0.3);
    flex-shrink: 0;
}

.calendar-legend__label {
    font-weight: 500;
    color: #475569;
}

.calendar-cell {
    aspect-ratio: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.4rem 0.45rem 0.35rem;
    border-right: 1px solid #eef2f6;
    border-bottom: 1px solid #eef2f6;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    position: relative;
    color: #0f172a;
    background: #fff;
}

.calendar-cell:nth-child(7n) {
    border-right: none;
}

.calendar-cell:nth-child(n + 36) {
    border-bottom: none;
}

.calendar-cell:hover:not(.calendar-cell--outside) {
    background-color: #f8fafc;
}

.calendar-cell--outside {
    color: #b8c2d0;
    cursor: default;
    background: #fcfdfe;
}

.calendar-cell--outside:hover {
    background: #fcfdfe;
}

.calendar-cell--holiday {
    background: rgba(254, 226, 226, 0.55);
}

.calendar-cell--holiday.calendar-cell--outside {
    background: rgba(254, 226, 226, 0.28);
}

.calendar-cell--holiday:hover:not(.calendar-cell--outside) {
    background: rgba(254, 202, 202, 0.65);
}

.calendar-cell--holiday.calendar-cell--selected {
    background: linear-gradient(180deg, rgba(254, 226, 226, 0.75) 0%, rgba(219, 234, 254, 0.85) 100%);
}

.calendar-cell--sun:not(.calendar-cell--outside) .calendar-day-num,
.calendar-cell--holiday:not(.calendar-cell--outside) .calendar-day-num {
    color: #dc2626;
}

.calendar-day-num {
    font-weight: 600;
    line-height: 1.2;
    font-size: 0.84rem;
    position: relative;
    z-index: 1;
}

/* Today: filled circle on the day number (in-month) */
.calendar-cell--today:not(.calendar-cell--outside) .calendar-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.85rem;
    min-height: 1.85rem;
    margin: -0.15rem 0 0 -0.1rem;
    padding: 0 0.15rem;
    border-radius: 50%;
    background: #0d9488;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(13, 148, 136, 0.35);
}

.calendar-cell--today.calendar-cell--sun:not(.calendar-cell--outside) .calendar-day-num,
.calendar-cell--today.calendar-cell--holiday:not(.calendar-cell--outside) .calendar-day-num {
    color: #ffffff;
}

/* Today + selected: blue circle, cell keeps selection ring */
.calendar-cell--today.calendar-cell--selected:not(.calendar-cell--outside) .calendar-day-num {
    background: #2563eb;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px #2563eb;
}

/* Today shown in adjacent month row (muted ring) */
.calendar-cell--today.calendar-cell--outside .calendar-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    min-height: 1.65rem;
    border-radius: 50%;
    color: #0f766e;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px #5eead4;
}

.calendar-cell-markers {
    margin-top: auto;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3px;
    width: 100%;
    padding-bottom: 3px;
    max-height: calc(100% - 1.35rem);
    overflow: hidden;
}

.calendar-cell-markers:has(.calendar-dot:nth-child(4)) {
    gap: 2px;
    padding-bottom: 2px;
}

.calendar-cell-markers:has(.calendar-dot:nth-child(6)) {
    gap: 1px;
}

.calendar-dot {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.calendar-cell-markers:has(.calendar-dot:nth-child(4)) .calendar-dot {
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.calendar-cell-markers:has(.calendar-dot:nth-child(6)) .calendar-dot {
    min-width: 20px;
    height: 20px;
    padding: 0 3px;
    border-radius: 10px;
    font-size: 0.68rem;
}

.calendar-dot--teal {
    background: #0d9488;
}

.calendar-dot--orange {
    background: #f97316;
}

.calendar-dot--purple {
    background: #9333ea;
}

.calendar-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
    line-height: 1;
}

.calendar-marker__value {
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}

.calendar-marker__history-icon {
    flex-shrink: 0;
}

.calendar-marker--dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    padding: 0;
    border-radius: 50%;
    background: #2196f3;
}

.calendar-marker--count {
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 11px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    box-shadow: inset 0 0 0 1.5px rgba(15, 23, 42, 0.12);
}

.calendar-cell--today:not(.calendar-cell--outside) .calendar-marker--count {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85);
}

.calendar-marker--history-count {
    font-size: 0.68rem;
    font-weight: 700;
    color: #16a34a;
    gap: 1px;
}

.calendar-marker--history-count .calendar-marker__history-icon {
    color: #16a34a;
}

.calendar-marker--emoji,
.calendar-marker--text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #16a34a;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-cell--selected {
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 65%);
    box-shadow: inset 0 0 0 2px #2563eb;
    z-index: 1;
}

.calendar-cell--selected:not(.calendar-cell--today) .calendar-day-num {
    color: #1e40af;
    font-weight: 700;
}

.calendar-cell--selected.calendar-cell--today:not(.calendar-cell--outside) .calendar-day-num {
    color: #ffffff;
}

.calendar-cell--pinned .calendar-pin-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    cursor: default;
    pointer-events: none;
}

.calendar-cell--pinned .calendar-pin-badge svg {
    width: 11px;
    height: 11px;
}

.calendar-cell--pinned .calendar-day-num {
    padding-right: 1.25rem;
}

/* ========== EVENTS SECTION ========== */
.events-section {
    background-color: #ffffff;
    padding: 1.5rem 1.6rem 1.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.events-title {
    font-size: 1.02rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.15rem 0;
    padding: 0 0 0.65rem 0;
    border-bottom: 1px solid #e8ecf0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.events-empty {
    margin: 0.5rem 0 0;
    padding: 1rem 1.1rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.events-empty--hidden {
    display: none;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.event-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.event-item:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.event-item--selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 4px 16px rgba(37, 99, 235, 0.12);
}

.event-item--holiday {
    background: rgba(254, 226, 226, 0.35);
}

.event-item--holiday:hover {
    background: rgba(254, 202, 202, 0.45);
}

.audit-log-filters {
    margin-bottom: 1rem;
}

.holiday-filters {
    margin-bottom: 1rem;
}

.audit-log-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.audit-log-pagination__info {
    font-size: 0.9375rem;
    color: #475569;
}

.event-marker {
    width: 5px;
    min-width: 5px;
    flex-shrink: 0;
    background: var(--accent-color, #14b8a6);
    border-radius: 12px 0 0 12px;
}

.event-item__shell {
    flex: 1;
    min-width: 0;
    padding: 1rem 1.15rem 1.05rem 1rem;
}

.event-item__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.event-item__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.event-item__head .event-category {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.event-category {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.4rem 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f766e;
    line-height: 1.25;
}

.event-category__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #14b8a6;
    flex-shrink: 0;
}

.event-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.85rem 0;
    line-height: 1.45;
    letter-spacing: -0.01em;
}

.event-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}

.event-field {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.event-field__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-field__icon svg {
    display: block;
}

.event-field__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    padding-top: 0.15rem;
}

.event-field__label {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.2;
}

.event-field__value {
    font-size: 0.84rem;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.45;
}

.event-footer {
    margin: 0;
    padding-top: 0;
    border-top: none;
    font-size: 0.8rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.event-item__footer,
.schedule-box__footer {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-start;
}

.event-btn--detail {
    width: auto;
    flex: 0 0 auto;
}

.event-btn {
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.event-btn--edit {
    color: #64748b;
}

.event-btn--edit:hover {
    color: #334155;
    background: #f1f5f9;
}

.event-btn--delete {
    color: #ef4444;
}

.event-btn--delete:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* ========== RIGHT SIDEBAR (inside content-wrapper) ========== */
.right-sidebar {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    align-self: stretch;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--box-shadow);
    padding: 1rem 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow: hidden;
}

.right-sidebar-title {
    flex-shrink: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 0.75rem;
    margin: 0 0 0.15rem 0;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.right-sidebar-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-box {
    position: relative;
    padding: 1.2rem 1.25rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.schedule-box--pinned {
    border-color: #dbeafe;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.schedule-pin {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    padding: 0;
    transition: background-color 0.2s ease;
}

.schedule-pin:hover {
    background: rgba(37, 99, 235, 0.16);
}

.schedule-box--pinned .schedule-box__head {
    padding-right: 2.85rem;
}

.schedule-box__head {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.schedule-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
}

.schedule-description {
    font-size: 0.8rem;
    font-weight: 400;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.schedule-meta {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.schedule-meta__row--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    align-items: start;
}

.schedule-meta__row--split > .schedule-field:only-child {
    grid-column: 1 / -1;
}

.schedule-meta__row--split .schedule-field__value {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 340px) {
    .schedule-meta__row--split {
        grid-template-columns: 1fr;
    }

    .schedule-meta__row--split > .schedule-field:only-child {
        grid-column: auto;
    }
}

.schedule-field {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.schedule-field--block {
    align-items: flex-start;
}

.schedule-field__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-field__icon svg {
    display: block;
}

.schedule-field__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    padding-top: 0.1rem;
}

.schedule-field__label {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.25;
}

.schedule-field__value {
    font-size: 0.84rem;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.45;
}

.schedule-empty {
    margin: 0;
    padding: 0.5rem 0.15rem;
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.5;
    text-align: center;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

/* ========== SWEETALERT2 ========== */
.swal2-popup.mycalendar-swal-popup {
    font-family: 'Noto Sans Khmer', system-ui, sans-serif;
    border-radius: 12px;
}

.swal2-popup.mycalendar-swal-popup .swal2-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
}

.swal2-popup.mycalendar-swal-popup .swal2-html-container {
    font-size: 0.92rem;
    color: var(--text-light);
}

/* ========== MODAL STYLES ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-form-error {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.85rem;
    line-height: 1.45;
}

.form-label-optional {
    font-weight: 400;
    color: #64748b;
}

.modal-form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-form .modal-notify-push {
    margin: 0;
}

.modal-form .modal-notify-push .settings-toggle-row {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
}

.event-scope-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.event-scope-choice:hover {
    border-color: var(--primary-color);
    color: var(--text-dark);
}

.event-scope-choice:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 107, 168, 0.1);
}

.event-scope-choice--selected {
    border-color: var(--primary-color);
    background: rgba(30, 107, 168, 0.08);
    color: var(--primary-color);
    font-weight: 600;
}

.event-scope-choice__text {
    pointer-events: none;
}

.event-scope-choice--readonly {
    cursor: default;
    pointer-events: none;
}

.event-scope-choice--readonly:not(.event-scope-choice--selected) {
    color: #94a3b8;
    background: #f8fafc;
}

.modal-form-loading {
    margin: 0;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    color: #64748b;
    text-align: center;
}

.form-value-static {
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-dark);
    background-color: #f8fafc;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.form-value-static--textarea {
    min-height: 100px;
    white-space: pre-wrap;
}

.file-upload-panel--readonly {
    min-height: auto;
    padding: 0.75rem 1rem;
}

.file-upload-panel--readonly.file-upload-panel--has-files {
    padding: 1rem;
}

.file-upload-panel--readonly .form-value-static {
    border: none;
    background: transparent;
    padding: 0;
    color: #94a3b8;
    font-size: 0.88rem;
}

.event-detail-form #eventDetailModalContent {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.event-detail-form #eventDetailModalContent[hidden] {
    display: none;
}

.event-detail-attachment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
}

.event-detail-attachment-list--visible {
    display: flex;
}

.event-detail-attachment {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.event-detail-attachment__preview-link {
    flex-shrink: 0;
    display: block;
    width: 4.75rem;
    height: 5.75rem;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.event-detail-attachment__preview-link:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(30, 107, 168, 0.12);
}

.event-detail-attachment__preview {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
}

.event-detail-attachment__preview--thumbnail {
    background: #ffffff;
}

.event-detail-attachment__preview--thumbnail .event-detail-attachment__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.event-detail-attachment__img,
.event-detail-attachment__canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.event-detail-attachment__status {
    padding: 0.25rem;
    font-size: 0.65rem;
    color: #64748b;
    text-align: center;
    line-height: 1.3;
}

.event-detail-attachment__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    font-size: 0.62rem;
}

.event-detail-attachment__name {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    line-height: 1.35;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-detail-attachment__name:hover {
    color: var(--accent-teal, #0d9488);
    text-decoration: underline;
}

/* ========== FORM STYLES ========== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.required {
    color: var(--danger-color);
    margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 107, 168, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #999;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
}

/* ========== FORM ROW ========== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ========== FILE UPLOAD ========== */
.file-upload-panel {
    border: 1.5px dashed #d1d9e6;
    border-radius: 12px;
    padding: 1rem 1rem 0.85rem;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.file-upload-panel--dragover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.file-upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 0.5rem 0.65rem;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    margin: 0;
}

.file-upload-drop__icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #e8f4fc;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-drop__title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.35;
}

.file-upload-drop__hint {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
    max-width: 22rem;
}

.file-upload-panel--has-files .file-upload-drop {
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e8ecf0;
}

.file-upload-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
}

.file-upload-list--visible {
    display: flex;
}

.file-upload-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.file-upload-item__thumb {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.file-upload-item__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.file-upload-item__icon--pdf {
    background: #64748b;
}

.file-upload-item__icon--word {
    background: #2563eb;
}

.file-upload-item__icon--excel {
    background: #059669;
}

.file-upload-item__icon--image {
    background: #7c3aed;
}

.file-upload-item__name {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 500;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload-item__link {
    text-decoration: none;
    color: var(--accent-teal, #0d9488);
}

.file-upload-item__link:hover {
    text-decoration: underline;
}

.file-upload-item--saved .file-upload-item__icon {
    opacity: 0.92;
}

.file-upload-item__remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.file-upload-item__remove:hover {
    background: #fef2f2;
}

.file-upload-item__remove:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.file-upload-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(30, 107, 168, 0.28);
}

.file-upload-add:hover {
    background: #1a5f94;
}

.file-upload-add:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.file-upload-error {
    margin: 0;
    font-size: 0.82rem;
    color: #dc2626;
    line-height: 1.4;
}

.file-upload-error[hidden] {
    display: none;
}

.file-input {
    display: none;
}

/* ========== FORM ACTIONS ========== */
.form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* ========== RESPONSIVE MODAL ========== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-form {
        padding: 1.5rem;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1180px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .right-sidebar {
        position: static;
        max-height: none;
        width: 100%;
    }
}

@media (max-width: 1100px) {
    .stats-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .welcome-section-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem 1.35rem;
        gap: 1rem;
    }

    .welcome-actions {
        width: 100%;
    }

    .welcome-actions .btn,
    .welcome-actions .btn-welcome-cta {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container-main {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-btn {
        width: auto;
    }

    .sidebar-logo {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
    }

    .logo-ring {
        width: 56px;
        height: 56px;
    }

    .logo-text {
        text-align: left;
    }

    .main-content {
        padding: 0;
        gap: 1rem;
    }

    .stats-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .right-sidebar {
        flex-direction: column;
        overflow-x: visible;
        overflow-y: visible;
        gap: 0.85rem;
    }

    .right-sidebar-title {
        flex: none;
        width: auto;
    }

    .schedule-box {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-section {
        grid-template-columns: 1fr;
    }

    .event-meta-grid {
        grid-template-columns: 1fr;
    }

    .event-item__head {
        flex-wrap: wrap;
    }

    .meetings-panel__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .meetings-panel__create {
        justify-content: center;
    }

    .meetings-panel__filter-row--criteria {
        grid-template-columns: 1fr;
    }

    .meetings-panel__filter-row--search {
        flex-direction: column;
        align-items: stretch;
    }

    .meetings-panel__filter-row--search .meetings-search__btn {
        width: 100%;
        justify-content: center;
    }

    .meetings-table-wrap {
        margin: 0 -0.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .meetings-table {
        min-width: 52rem;
    }

    .users-page__intro {
        margin-bottom: 1rem;
    }

    .users-panel__toolbar {
        justify-content: stretch;
    }

    .users-panel__add {
        width: 100%;
        justify-content: center;
    }

    .users-table {
        min-width: 44rem;
    }
}

/* ========== MEETINGS PAGE ========== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.meetings-panel {
    background: var(--bg-white);
    border: 1px solid #e8ecf0;
    border-radius: var(--radius-md);
    box-shadow: var(--box-shadow-card);
    padding: 1.35rem 1.5rem 1.5rem;
}

.meetings-panel__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.meetings-panel__subtitle {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.45;
}

.meetings-panel__create {
    padding: 0.65rem 1.15rem;
    font-size: 0.88rem;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(30, 107, 168, 0.28);
}

.meetings-panel__filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.meetings-panel__filter-row--criteria {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.meetings-panel__filter-row--search {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.meetings-panel__filter-row--search .meetings-search {
    flex: 1 1 14rem;
    min-width: 0;
}

.meetings-panel__filter-row--export {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.meetings-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
}

@media (max-width: 720px) {
    .meetings-panel__filter-row--criteria {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meetings-panel__filter-row--criteria .meetings-filter-field:last-child {
        grid-column: 1 / -1;
    }
}

.meetings-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 9rem;
}

.meetings-filter-field__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.2;
}

.meetings-filter-field__input,
.meetings-filter-field__select {
    min-height: 42px;
    padding: 0.45rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
    font-size: 0.88rem;
    color: #0f172a;
}

.meetings-filter-field__input:focus-visible,
.meetings-filter-field__select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.meetings-search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    min-height: 42px;
}

.meetings-search__icon {
    flex-shrink: 0;
    color: #94a3b8;
}

.meetings-search__input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.88rem;
    color: #0f172a;
    outline: none;
}

.meetings-search__input::placeholder {
    color: #94a3b8;
}

.meetings-search__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0 1rem;
    white-space: nowrap;
}

.meetings-status-filter {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    min-height: 42px;
    min-width: 11.5rem;
}

.meetings-status-filter__icon {
    flex-shrink: 0;
    color: #64748b;
}

.meetings-status-filter__select {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.88rem;
    color: #0f172a;
    outline: none;
    cursor: pointer;
    appearance: none;
    padding-right: 0.25rem;
}

.meetings-table-wrap {
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    overflow: auto;
    background: #ffffff;
}

.meetings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    table-layout: fixed;
}

.meetings-table thead {
    background: #1e4d7b;
    color: #ffffff;
}

.meetings-table th {
    padding: 0.85rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    vertical-align: middle;
}

.meetings-table th span {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.meetings-table__sort-icon {
    opacity: 0.85;
    flex-shrink: 0;
}

.meetings-table__col-index {
    width: 3.5rem;
    text-align: center;
}

.meetings-table__col-title {
    width: 16%;
}

.meetings-table__col-desc {
    width: 26%;
}

.meetings-table__col-type {
    width: 11%;
}

.meetings-table__col-date {
    width: 12%;
}

.meetings-table__col-location {
    width: 14%;
}

.meetings-table__col-actions {
    width: 6.5rem;
    text-align: center;
}

.meetings-table tbody tr {
    border-bottom: 1px solid #eef2f6;
}

.meetings-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.meetings-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.meetings-table tbody tr:hover {
    background: #f1f5f9;
}

.meetings-table tbody tr[hidden] {
    display: none;
}

.meetings-table td {
    padding: 0.8rem 0.75rem;
    vertical-align: top;
    color: #0f172a;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.meetings-table__cell-index {
    text-align: center;
    font-weight: 600;
    color: #475569;
    vertical-align: middle;
    white-space: nowrap;
}

.meetings-table__cell-title {
    font-weight: 600;
}

.meetings-table__cell-desc {
    color: #475569;
}

.meetings-table__cell-location {
    color: #334155;
}

.meetings-table__cell-title > .event-footer,
.meetings-table__cell-desc > .event-footer,
.meetings-table__cell-location > .event-footer {
    max-width: 100%;
}

.meetings-table__cell-title > .event-footer {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
}

.meetings-table__cell-desc > .event-footer {
    color: #475569;
}

.meetings-table__cell-location > .event-footer {
    font-size: 0.84rem;
    font-weight: 500;
    color: #334155;
}

.meetings-table__cell-actions {
    vertical-align: middle;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.meetings-type {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
    white-space: nowrap;
}

.meetings-type__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.meetings-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.meetings-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    color: #64748b;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.meetings-action-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.meetings-action-btn--view:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--primary-color);
}

.meetings-action-btn--delete {
    color: #ef4444;
}

.meetings-action-btn--delete:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.meetings-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e8ecf0;
}

.meetings-pagination--hidden {
    display: none;
}

.meetings-pagination__summary {
    margin: 0;
    font-size: 0.84rem;
    color: #64748b;
}

.meetings-pagination__controls {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.meetings-pagination__indicator {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    min-width: 6.5rem;
    text-align: center;
}

.meetings-pagination__btn {
    min-height: 36px;
    padding: 0.35rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: #1e4d7b;
    cursor: pointer;
}

.meetings-pagination__btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.meetings-pagination__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .meetings-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .meetings-pagination__controls {
        justify-content: center;
    }
}

.meetings-empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.meetings-empty--hidden {
    display: none;
}

/* ========== USERS PAGE ========== */
.users-page {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.users-page__intro {
    margin: 0;
}

.users-page__title {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.users-page__subtitle {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 400;
    color: #64748b;
    line-height: 1.45;
}

.calendar-context-banner {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
}

.users-panel {
    background: var(--bg-white);
    border: 1px solid #e8ecf0;
    border-radius: var(--radius-md);
    box-shadow: var(--box-shadow-card);
    padding: 1.35rem 1.5rem 1.5rem;
}

.users-panel__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.users-panel__toolbar--actions {
    flex-wrap: wrap;
}

.users-panel__toolbar-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.holiday-import-label {
    cursor: pointer;
    margin: 0;
}

.users-panel__toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.users-panel__add {
    padding: 0.65rem 1.15rem;
    font-size: 0.88rem;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(30, 107, 168, 0.28);
}

.users-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    min-height: 42px;
    margin-bottom: 1.15rem;
}

.users-search__icon {
    flex-shrink: 0;
    color: #94a3b8;
}

.users-search__input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.88rem;
    color: #0f172a;
    outline: none;
}

.users-search__input::placeholder {
    color: #94a3b8;
}

.users-table-wrap {
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    overflow: auto;
    background: #ffffff;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.users-table thead {
    background: #1e4d7b;
    color: #ffffff;
}

.users-table th {
    padding: 0.85rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    vertical-align: middle;
}

.users-table th span {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.users-table__sort-icon {
    opacity: 0.85;
    flex-shrink: 0;
}

.users-table__col-index {
    width: 3.5rem;
    text-align: center;
}

.users-table__col-actions {
    min-width: 11rem;
}

.users-table tbody tr {
    border-bottom: 1px solid #eef2f6;
}

.users-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.users-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.users-table tbody tr:hover {
    background: #f1f5f9;
}

.users-table tbody tr[hidden] {
    display: none;
}

.users-table td {
    padding: 0.8rem 0.75rem;
    vertical-align: middle;
    color: #0f172a;
    line-height: 1.45;
}

.users-table__cell-index {
    text-align: center;
    font-weight: 600;
    color: #475569;
}

.users-name-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.users-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.users-name-cell__text {
    font-weight: 600;
    min-width: 0;
}

.users-table__cell-email {
    color: #475569;
}

.users-table__cell-role {
    font-weight: 500;
    white-space: nowrap;
}

.users-table__cell-actions {
    text-align: left;
}

.users-remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff5f5;
    color: #dc2626;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.users-remove-btn:hover {
    background: #fef2f2;
    border-color: #f87171;
}

.users-remove-btn svg {
    flex-shrink: 0;
}

.users-empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.users-empty--hidden {
    display: none;
}

.users-add-modal {
    max-width: 480px;
}

.users-add-modal__permissions {
    gap: 0.65rem;
}

.users-add-modal__check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: #334155;
    cursor: pointer;
}

.users-add-modal__check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
}

.form-hint {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
}

/* ========== PROFILE & SETTINGS (centered 10/12 column) ========== */
.workspace-body--profile,
.workspace-body--centered {
    align-items: center;
    padding-left: 1rem;
    padding-right: 1rem;
}

.main-content.profile-page,
.main-content.settings-page {
    width: calc(100% * 10 / 12);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    flex: 0 1 auto;
    align-self: center;
    padding: 0.5rem 0 1.5rem;
    gap: 1.35rem;
}

.profile-page {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.profile-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.profile-back:hover {
    color: #0f172a;
}

.profile-alert {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.profile-alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.profile-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.profile-hero {
    text-align: center;
    padding: 2.25rem 2rem 1.75rem;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 45%, #ffffff 100%);
    border: 1px solid #e8ecf0;
    box-shadow: var(--box-shadow-card);
}

.profile-hero__avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.profile-hero__avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.profile-hero__file-input {
    display: none;
}

.profile-hero__name {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.45;
}

.profile-hero__position {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
}

.profile-hero__email {
    margin: 0 0 1.1rem;
    font-size: 0.88rem;
    color: #64748b;
}

.profile-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.profile-hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.profile-hero__btn--text {
    border: none;
    background: transparent;
    color: #dc2626;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0.55rem 0.75rem;
}

.profile-hero__btn--text:hover {
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.5);
    border-radius: 8px;
}

.profile-hero__hint {
    margin: 0;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.5;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

.profile-card {
    background: var(--bg-white);
    border: 1px solid #e8ecf0;
    border-radius: var(--radius-md);
    box-shadow: var(--box-shadow-card);
    padding: 1.5rem 1.75rem 1.65rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.profile-card__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
}

.profile-card__fields .profile-field--full {
    grid-column: 1 / -1;
}

.profile-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.profile-card__hint {
    margin: -0.35rem 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.45;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-field__label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
}

.profile-field__required {
    color: #dc2626;
    margin-left: 0.15rem;
}

.profile-field__input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font: inherit;
    font-size: 0.9rem;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-field__input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.profile-field__input--readonly {
    background: #f8fafc;
    color: #64748b;
    cursor: default;
}

.profile-field__input::placeholder {
    color: #94a3b8;
}

.profile-field__password-wrap {
    position: relative;
}

.profile-field__password-wrap .profile-field__input {
    padding-right: 2.75rem;
}

.profile-field__toggle-pw {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.profile-field__toggle-pw:hover {
    color: #475569;
    background: #f1f5f9;
}

.profile-card__actions {
    padding-top: 0.25rem;
}

.profile-card__actions .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
}

@media (max-width: 768px) {
    .main-content.profile-page,
    .main-content.settings-page {
        width: 100%;
    }

    .profile-card__fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .workspace-body--profile {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .profile-hero {
        padding: 1.5rem 1rem 1.25rem;
    }

    .profile-card {
        padding: 1.15rem 1rem 1.25rem;
    }
}

/* ========== SETTINGS PAGE ========== */
.settings-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-page__loading,
.settings-page__error,
.settings-page__status {
    margin: 0;
    font-size: 0.85rem;
}

.settings-page__loading {
    color: #64748b;
}

.settings-page__error {
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.settings-page__status {
    color: #15803d;
}

.settings-page__loading[hidden],
.settings-page__error[hidden],
.settings-page__status[hidden] {
    display: none;
}

.settings-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
}

.settings-back:hover {
    color: #0f172a;
}

.settings-card {
    background: var(--bg-white);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    box-shadow: var(--box-shadow-card);
    padding: 1.5rem 1.75rem 1.75rem;
}

.settings-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.settings-card__title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eef2f6;
    margin-bottom: 1.25rem;
}

.settings-toggle-row__label {
    margin: 0 0 0.25rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
}

.settings-toggle-row__hint {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.45;
}

.settings-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.settings-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-switch__track {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background-color 0.2s ease;
    position: relative;
}

.settings-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
}

.settings-switch__input:checked + .settings-switch__track {
    background: var(--primary-color);
}

.settings-switch__input:checked + .settings-switch__track::after {
    transform: translateX(20px);
}

.settings-switch__input:focus-visible + .settings-switch__track {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.settings-monthly-panel[hidden] {
    display: none;
}

.settings-monthly-panel {
    padding-top: 0.25rem;
}

.settings-past-date-panel[hidden] {
    display: none;
}

.settings-past-date-panel {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
}

.settings-past-date-panel__fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.settings-past-date-panel__legend {
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.45rem;
}

.settings-past-date-panel__option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0;
    font-size: 0.86rem;
    color: #1e293b;
    cursor: pointer;
}

.settings-past-date-panel__value-field {
    margin-top: 0.65rem;
}

.settings-past-date-panel__value-field label,
.settings-past-date-panel__value-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.3rem;
}

.settings-emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.settings-emoji-picker__btn {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #16a34a;
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-emoji-picker__btn:hover {
    background: #eef6fc;
    border-color: #93c5fd;
}

.settings-emoji-picker__btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.settings-emoji-picker__btn.is-selected {
    background: #eef6fc;
    border-color: #2563eb;
    color: #15803d;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.28);
}

.settings-color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.settings-color-picker__input {
    width: 3rem;
    height: 2.35rem;
    padding: 0.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
}

.settings-color-picker__input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.settings-color-picker__input::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.settings-color-picker__input::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.settings-color-picker__input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.settings-color-picker__hex {
    flex: 1;
    max-width: 8.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
}

.settings-past-date-panel__preview {
    margin-top: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.settings-past-date-panel__preview-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.settings-past-date-panel__preview-marker {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    color: #16a34a;
}

.settings-months-block {
    margin-bottom: 1.35rem;
}

.settings-months__heading {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
}

.settings-months {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.settings-months::-webkit-scrollbar {
    height: 4px;
}

.settings-months::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.settings-month-btn {
    flex: 0 0 auto;
    min-width: 3.1rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.settings-month-btn:hover {
    border-color: #cbd5e1;
    background: #e8f0f7;
}

.settings-month-btn--active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 107, 168, 0.28);
}

.settings-backgrounds__error {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.8rem;
    line-height: 1.4;
}

.settings-backgrounds__error[hidden] {
    display: none;
}

.settings-backgrounds__loading {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: #64748b;
}

.settings-backgrounds__loading[hidden] {
    display: none;
}

.settings-background-gallery {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.25rem;
}

.settings-background-gallery__cards {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.25rem;
}

.settings-background-gallery__item {
    position: relative;
    flex: 0 0 148px;
    width: 148px;
}

.settings-background-gallery__delete {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.settings-background-gallery__delete:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.settings-background-gallery__delete:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.settings-background-gallery__card {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.settings-background-gallery__card[hidden] {
    display: none;
}

.settings-background-gallery__card--selectable {
    position: relative;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-background-gallery__card--selectable:hover {
    border-color: #93c5fd;
}

.settings-background-gallery__card--selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.settings-background-gallery__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-background-gallery__img--error {
    display: none;
}

.settings-background-gallery__card--selectable:has(.settings-background-gallery__img--error)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* Dashed click-to-upload card (always visible at end of gallery) */
.settings-background-upload__zone {
    position: relative;
    display: flex;
    flex: 0 0 148px;
    width: 148px;
    aspect-ratio: 9 / 16;
    margin: 0;
    border: 2px dashed #60a5fa;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-background-upload__zone:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.12);
}

.settings-background-upload__zone:focus-within {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.settings-background-upload__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 1rem 0.75rem;
    text-align: center;
    color: var(--primary-color);
}

.settings-background-upload__icon {
    flex-shrink: 0;
    color: var(--primary-color);
}

.settings-background-upload__label {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--primary-color);
}

.settings-background-upload__file {
    display: none;
}

@media (max-width: 520px) {
    .settings-background-gallery__item,
    .settings-background-upload__zone {
        width: calc((100% - 1.7rem) / 3);
        flex: 0 0 calc((100% - 1.7rem) / 3);
        max-width: 132px;
    }

    .settings-background-gallery {
        gap: 0.85rem;
    }

    .settings-month-btn {
        min-width: 2.75rem;
        padding: 0.4rem 0.5rem;
        font-size: 0.72rem;
    }
}

/* ========== PUBLIC LEGAL PAGES ========== */
body.legal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--page-bg);
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.legal-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-dark);
}

.legal-header__logo {
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.legal-header__title {
    font-size: 1.05rem;
    font-weight: 600;
}

.legal-header__login {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
}

.legal-header__login:hover {
    background: #f8fafc;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.legal-nav__link {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: none;
    padding-bottom: 0.15rem;
    border-bottom: 2px solid transparent;
}

.legal-nav__link:hover {
    color: var(--primary-color);
}

.legal-nav__link--active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
}

.legal-main {
    flex: 1;
    padding: 2rem 1.5rem 3rem;
}

.legal-article {
    max-width: 760px;
    margin: 0 auto;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--box-shadow);
    padding: 2rem 2.25rem;
}

.legal-article__title {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.legal-article__meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.legal-article__body h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.75rem 0 0.65rem;
    color: var(--text-dark);
}

.legal-article__body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.legal-article__body p,
.legal-article__body li {
    font-size: 0.95rem;
    line-height: 1.75;
    color: #334155;
    margin-bottom: 0.75rem;
}

.legal-article__body ul {
    margin: 0 0 1rem 1.25rem;
}

.legal-article__body a {
    color: var(--primary-color);
}

.legal-lead {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 1.5rem;
}

.legal-see-also {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-light);
}

.legal-footer {
    padding: 1.25rem 1.5rem 1.75rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    background: var(--bg-white);
}

.legal-footer__links {
    margin-top: 0.5rem;
}

.legal-footer__links a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-legal-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.82rem;
}

.login-legal-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-legal-links a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .legal-article {
        padding: 1.35rem 1.15rem;
    }

    .legal-article__title {
        font-size: 1.35rem;
    }
}
