:root {
    --primary-color: #2b509f;
    --primary-light: color-mix(in srgb, var(--primary-color) 20%, transparent);
    --primary-tint: color-mix(in srgb, var(--primary-color) 15%, transparent);

    --bg-main: #F0F0F2;
    --bg-sidebar: #FFFFFF;
    --bg-header: #FFFFFF;
    --bg-card: #FFFFFF;

    --text-main: #18181B;
    --text-secondary: #52525B;
    --text-muted: #A1A1AA;

    --border-color: #E4E4E7;

    --nav-width: 68px;
    --header-height: 60px;
    --sidebar-padding: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

img {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ──────────────────────────────────────────── */

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: #FFFFFF;
    padding: 0;
    gap: 0;
}

/* ─── Sidebar ─────────────────────────────────────────── */

.sidebar {
    width: var(--nav-width);
    background-color: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0 20px;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
    height: 100vh;
}

.sidebar-top,
.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    align-items: center;
}

.sidebar-logo {
    height: 68px;
    margin-bottom: -2px;
    /* Offsets the 2px gap from .sidebar-top to perfectly align with frame top */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.icon-item {
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 11px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    position: relative;
}

.icon-item img {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.icon-item .icon-outline {
    display: block;
    opacity: 0.5;
    filter: grayscale(100%) brightness(0);
}

.icon-item .icon-filled {
    display: none;
}

.icon-item:hover {
    background-color: var(--bg-main);
}

.icon-item:hover .icon-outline {
    opacity: 0.65;
}

.icon-item.active {
    background-color: var(--primary-tint);
}

.icon-item.active .icon-outline {
    display: none;
}

.icon-item.active .icon-filled {
    display: block;
}

/* ─── User profile in sidebar ─────────────────────────── */

.user-profile {
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 6px;
    border: 1px solid var(--border-color);
    /* pastel background shown before image loads */
    background: #E8F0FD;
    flex-shrink: 0;
}

.user-profile:hover {
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 8px;
}

/* ─── Main wrapper ────────────────────────────────────── */

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    padding: 0;
    gap: 0;
}

/* ─── Top header ──────────────────────────────────────── */

.top-header {
    height: 68px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 24px 0 0;
    flex-shrink: 0;
}

.workspace-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.workspace-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    /* pastel placeholder before logo loads */
    background: #E8F0FD;
    flex-shrink: 0;
}

.workspace-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.2px;
}

.badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.badge-img {
    width: 16px;
    height: 16px;
}

.badge-blue {
    filter: invert(35%) sepia(85%) saturate(400%) hue-rotate(190deg) brightness(95%) contrast(90%);
}

.badge-purple {
    filter: invert(36%) sepia(84%) saturate(3015%) hue-rotate(247deg) brightness(97%) contrast(97%);
}


.search-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
}

.search-box {
    background-color: var(--bg-main);
    border-radius: 10px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    border: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.search-box:focus-within {
    background-color: #fff;
    border-color: var(--border-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.search-icon {
    width: 16px;
    height: 16px;
    opacity: 0.4;
    flex-shrink: 0;
}

.search-bar {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-main);
    outline: none;
}

.search-bar::placeholder {
    color: var(--text-muted);
}

/* ─── Content scroll ──────────────────────────────────── */

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px;
    background-color: #FFFFFF;
    border-radius: 20px 0 0 0;
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: none;
    border-bottom: none;
    box-shadow: -4px -4px 24px rgba(0, 0, 0, 0.02);
}

/* ── Universal Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* ─── Welcome ─────────────────────────────────────────── */

.welcome-section {
    margin-bottom: 28px;
}

.welcome-section h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.welcome-section .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ─── Dashboard grid ──────────────────────────────────── */

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1200px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    padding: 18px 20px 14px;
    gap: 10px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.card-header-flex {
    padding: 18px 20px 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-left {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.card-icon-img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.header-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.header-text p.card-desc {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
}

.card-body {
    padding: 0 20px 20px;
}

.card-body.list-body {
    padding: 0;
}

/* ─── New staff grid ──────────────────────────────────── */

.new-staff-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    max-height: 164px;
    /* Exactly fits 2 rows of 74px cards + 10px gap + padding */
    overflow-y: auto;
    padding: 2px;
}

.staff-member {
    background-color: #FAFAFA;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.staff-member:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.staff-pfp-container {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.staff-pfp {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    /* pastel background for profile pictures */
    background: #E8F0FD;
    display: block;
}

.staff-role-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: #fff;
    border-radius: 50%;
    font-size: 11px;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.staff-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.staff-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ─── Empty state ─────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
    gap: 10px;
}

.empty-icon {
    width: 28px;
    height: 28px;
    opacity: 0.35;
}

/* ─── Bottom grid ─────────────────────────────────────── */

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.bottom-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bottom-column .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.bottom-column .card-body.list-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.bottom-column .empty-state {
    flex: 1;
}

.badge-birthday {
    font-size: 11px;
    font-weight: 600;
    background-color: var(--primary-tint);
    color: var(--primary-color);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid var(--primary-light);
    white-space: nowrap;
}

.badge-session {
    font-size: 11px;
    font-weight: 600;
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563EB;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}

.session-icon-container {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background-color: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.session-icon-img {
    width: 20px;
    height: 20px;
}

.list-item {
    display: flex;
    padding: 14px 20px;
    gap: 14px;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.15s;
    align-items: flex-start;
}

.list-item:hover {
    background-color: #F9F9FA;
}

.list-item img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: #E8F0FD;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    min-width: 0;
}

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

.item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.item-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 8px;
}

.item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-notice {
    font-size: 11px;
    font-weight: 600;
    background-color: #FFF3E0;
    color: #E65100;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #FFE0B2;
    white-space: nowrap;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.15s;
}

.view-all:hover {
    opacity: 0.75;
}

.view-all-icon {
    width: 14px;
    height: 14px;
}

/* ─── Shimmer ─────────────────────────────────────────── */

.shimmer-block {
    border-radius: 6px;
    background: linear-gradient(90deg, #E4E4E7 25%, #F0F0F1 50%, #E4E4E7 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ─── Mobile nav ──────────────────────────────────────── */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--bg-header);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    padding: 0 8px;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    padding: 6px 0;
}

.mobile-nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.mobile-nav-item img {
    width: 22px;
    height: 22px;
}

.mobile-nav-item .icon-outline {
    display: block;
    opacity: 0.45;
}

.mobile-nav-item .icon-filled {
    display: none;
}

.mobile-nav-item.active .icon-outline {
    display: none;
}

.mobile-nav-item.active .icon-filled {
    display: block;
}

.mobile-nav-item.active span {
    color: var(--primary-color);
}

.user-profile-mobile {
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    overflow: hidden;
    background: #E8F0FD;
}

.user-profile-mobile img {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ─── Responsive ──────────────────────────────────────── */

@media (max-width: 900px) {
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0;
        gap: 0;
    }

    .sidebar {
        display: none;
    }

    .main-wrapper {
        height: 100vh;
        gap: 0;
        border-radius: 0;
        padding-bottom: 60px;
    }

    .top-header {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .content-scroll {
        border-radius: 0;
        border: none;
        padding: 20px 16px;
    }

    .mobile-nav {
        display: flex;
    }

    .top-header {
        padding: 0 16px;
    }

    .search-container {
        width: 160px;
    }

    .welcome-section h2 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .search-container {
        display: none;
    }
}

/* ─── Page views ──────────────────────────────────────── */

.page-view {
    display: none;
}

.page-view.is-active {
    display: block;
}

/* ─── Settings page ───────────────────────────────────── */

.settings-page {
    width: min(1180px, 100%);
    padding-bottom: 28px;
}

.settings-header {
    margin-bottom: 22px;
    max-width: 720px;
}

.settings-header h2 {
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 6px;
}

.settings-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 12px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fafafa;
}

.settings-nav-item {
    border: none;
    background: transparent;
    text-align: left;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    width: 100%;
}

.settings-nav-item img {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: 0.58;
}

.settings-nav-item.is-active,
.settings-nav-item:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.settings-nav-item.is-active img,
.settings-nav-item:hover img {
    opacity: 0.9;
}

.settings-nav-item.is-active {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.settings-panel {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
    min-height: 420px;
}

.settings-panel.is-active {
    display: block;
}

.settings-panel h3 {
    font-size: 18px;
    line-height: 1.25;
    margin-bottom: 22px;
}

.settings-field {
    margin-bottom: 24px;
    max-width: 640px;
}

.settings-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.settings-field input[type="text"],
.settings-field input[type="url"],
.settings-field input[type="number"],
.settings-field select {
    width: 100%;
    max-width: 520px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 11px 13px;
    font-size: 13px;
    transition: all 0.2s ease;
    background-color: #FFFFFF;
    outline: none;
    color: var(--text-main);
}

.settings-field input[type="text"]:focus,
.settings-field input[type="url"]:focus,
.settings-field input[type="number"]:focus,
.settings-field select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.settings-help {
    color: var(--text-secondary);
    font-size: 12.5px;
    margin-bottom: 18px;
    line-height: 1.5;
    max-width: 680px;
}

.settings-check-grid,
.settings-perm-grid,
.settings-role-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.settings-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 46px;
}

.settings-check:hover {
    border-color: color-mix(in srgb, var(--primary-color) 40%, var(--border-color));
    background-color: var(--primary-tint);
}

.settings-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--text-muted);
    border-radius: 4px;
    outline: none;
    background-color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.settings-color-grid {
    display: grid;
    grid-template-columns: repeat(11, 30px);
    gap: 7px;
    align-items: center;
}

.settings-color-swatch {
    position: relative;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.settings-color-swatch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.settings-color-swatch.selected {
    border-color: rgba(15, 23, 42, 0.62);
    box-shadow: 0 0 0 2px #fff inset, 0 3px 10px rgba(15, 23, 42, 0.18);
}

.settings-color-swatch.selected::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
    transform: translate(-50%, -50%);
}

.settings-check input[type="checkbox"]:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.settings-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 2px;
    left: 5px;
}

/* Permissions Accordion Styling */
.permissions-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    max-width: 800px;
}

.perm-category-details {
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.perm-category-details[open] {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    border-color: var(--primary-color);
}

.perm-category-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color 0.2s;
}

.perm-category-summary::-webkit-details-marker {
    display: none;
}

.perm-category-summary:hover {
    background-color: var(--bg-main);
}

.summary-chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.perm-category-details[open] .summary-chevron {
    transform: rotate(180deg);
}

.perm-category-details .settings-perm-grid {
    padding: 16px 18px;
    background-color: #FAFAFB;
    border-top: 1.5px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

/* Card-Based Integrations sections */
.settings-section-card {
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 22px;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 12px;
}

.settings-card-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

/* Departments Grid */
.departments-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.department-card {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.01);
}

.department-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border-color: var(--primary-color);
}

.dep-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-tint);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.dep-info {
    flex: 1;
    min-width: 0;
}

.dep-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dep-remove-btn {
    border: none;
    background: transparent;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.15s;
}

.dep-remove-btn:hover {
    opacity: 1;
    background: #FEE2E2;
}

.dep-remove-btn img {
    width: 16px;
    height: 16px;
    filter: invert(24%) sepia(90%) saturate(6000%) hue-rotate(350deg) brightness(96%) contrast(98%);
}

.settings-inline {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    max-width: 520px;
}

.settings-inline input {
    min-width: 0;
    flex: 1;
}

.settings-list {
    list-style: none;
    display: grid;
    gap: 8px;
}

.settings-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    background-color: #FFFFFF;
}

.settings-empty {
    color: var(--text-muted);
    justify-content: center;
}

.settings-footer {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-bottom: 4px;
}

.settings-btn {
    border: 1.5px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.settings-btn img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.settings-btn.primary img,
.settings-btn.danger img {
    filter: brightness(0) invert(1);
}

.settings-btn.icon-only {
    width: 42px;
    min-width: 42px;
    padding: 0;
}

.settings-btn:hover {
    background-color: var(--bg-main);
    border-color: color-mix(in srgb, var(--primary-color) 30%, var(--border-color));
}

.settings-btn.primary {
    background: var(--primary-color);
    border-color: transparent;
    color: #fff;
}

.settings-btn.primary:hover {
    background: color-mix(in srgb, var(--primary-color) 85%, black);
}

.settings-btn.danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.settings-btn.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.settings-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
    max-width: 760px;
}

.settings-danger-zone h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.settings-danger-zone p {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.45;
}

.settings-danger-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.settings-btn.subtle {
    padding: 6px 10px;
    font-size: 12px;
}

.settings-status {
    font-size: 12px;
    color: var(--text-secondary);
}

.settings-api-key {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--bg-main);
    font-family: ui-monospace, monospace;
    font-size: 12.5px;
    word-break: break-all;
    border: 1.5px solid var(--border-color);
}

@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .settings-nav {
        flex-direction: row;
        flex-wrap: wrap;
        position: static;
        align-items: stretch;
    }

    .settings-nav-item {
        flex: 1 1 160px;
    }

    .settings-color-grid {
        grid-template-columns: repeat(auto-fill, 30px);
    }

    .settings-danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }

    .settings-danger-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .settings-panel {
        padding: 20px;
    }

    .settings-inline,
    .settings-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-btn {
        width: 100%;
    }

    .settings-btn.icon-only {
        width: 42px;
    }

    .settings-list li,
    .settings-danger-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
