/* Material 3 inspired design with a subtle blue hue */
:root {
    /* Light Mode Variables */
    --md-sys-color-background: #FAFCFF;
    --md-sys-color-on-background: #1A1C1E;
    --md-sys-color-surface: #FAFCFF;
    --md-sys-color-surface-container: #F0F4F8;
    --md-sys-color-on-surface: #1A1C1E;
    --md-sys-color-primary: #005AC1;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-secondary-container: #D8E2FF;
    --md-sys-color-on-secondary-container: #001A41;
    --md-sys-color-outline: #74777F;
    --md-sys-color-surface-variant: #E1E2E8;
    --md-sys-color-on-surface-variant: #4F5565;
    
    --nav-height: 80px;
    --header-height: 64px;
    
    /* --icon-filter: none; */
    --icon-filter: filter: brightness(0) saturate(100%) invert(9%) sepia(17%) saturate(259%) hue-rotate(169deg) brightness(94%) contrast(95%);
    --icon-active-filter: filter: brightness(0) saturate(100%) invert(9%) sepia(17%) saturate(259%) hue-rotate(169deg) brightness(94%) contrast(95%);
}

/* Dark Mode Variables applied via data-theme attribute */
:root[data-theme="dark"] {
    --md-sys-color-background: #111418;
    --md-sys-color-on-background: #E2E2E6;
    --md-sys-color-surface: #111418;
    --md-sys-color-surface-container: #1D2024;
    --md-sys-color-on-surface: #E2E2E6;
    --md-sys-color-primary: #ADC6FF;
    --md-sys-color-on-primary: #002E69;
    --md-sys-color-secondary-container: #004493;
    --md-sys-color-on-secondary-container: #D8E2FF;
    --md-sys-color-outline: #8E9099;
    --md-sys-color-surface-variant: #44474E;
    --md-sys-color-on-surface-variant: #C4C6CC;
    
    /* --icon-filter: invert(1) brightness(2); */
    --icon-filter: brightness(0) saturate(100%) invert(98%) sepia(1%) saturate(1855%) hue-rotate(202deg) brightness(88%) contrast(106%);
    --icon-active-filter: brightness(0) saturate(100%) invert(98%) sepia(1%) saturate(1855%) hue-rotate(202deg) brightness(88%) contrast(106%);
}

/* Fallback to system dark mode if data-theme="system" or not set, BUT only if not light */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --md-sys-color-background: #111418;
        --md-sys-color-on-background: #E2E2E6;
        --md-sys-color-surface: #111418;
        --md-sys-color-surface-container: #1D2024;
        --md-sys-color-on-surface: #E2E2E6;
        --md-sys-color-primary: #ADC6FF;
        --md-sys-color-on-primary: #002E69;
        --md-sys-color-secondary-container: #004493;
        --md-sys-color-on-secondary-container: #D8E2FF;
        --md-sys-color-outline: #8E9099;
        --md-sys-color-surface-variant: #44474E;
        
        /* --icon-filter: invert(1) brightness(2); */
        --icon-filter: brightness(0) saturate(100%) invert(98%) sepia(1%) saturate(1855%) hue-rotate(202deg) brightness(88%) contrast(106%);
        --icon-active-filter: brightness(0) saturate(100%) invert(98%) sepia(1%) saturate(1855%) hue-rotate(202deg) brightness(88%) contrast(106%);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    background-color: var(--md-sys-color-surface);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10;
}

.app-header h1 {
    font-size: 22px;
    font-weight: 500;
}

/* Main Content */
.content-container {
    flex: 1;
    margin-top: var(--header-height);
    margin-bottom: calc(var(--nav-height) + 8px);
    overflow-y: auto;
    padding: 16px 16px calc(var(--nav-height) + 8px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state {
    text-align: center;
    color: var(--md-sys-color-outline);
    margin-top: 40px;
    font-size: 14px;
}

.placeholder-card {
    margin-top: 16px;
    padding: 16px;
    border-radius: 16px;
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-outline);
    text-align: center;
    font-size: 14px;
}

/* Lists */
.item-list {
    list-style: none;
}

.list-item {
    background-color: var(--md-sys-color-surface-container);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.category-card-main {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.category-card-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    object-fit: contain;
    filter: var(--icon-filter);
    flex-shrink: 0;
}

.category-card-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    font-size: 16px;
}

.list-item-desc {
    font-size: 14px;
    color: var(--md-sys-color-outline);
}

.category-card-unit {
    font-size: 12px;
    margin-top: 2px;
}

.category-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.category-action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}

.category-action-btn img {
    width: 20px;
    height: 20px;
    filter: var(--icon-filter);
}

.category-action-btn.delete {
    background-color: #ffe1e1;
    color: #c62828;
}

.category-action-btn.delete img,
.instance-action-btn.delete img {
    filter: brightness(0) saturate(100%) invert(20%) sepia(91%) saturate(2331%) hue-rotate(348deg) brightness(91%) contrast(98%);
}

.delete-confirm-text {
    margin-bottom: 20px;
    line-height: 1.5;
    color: var(--md-sys-color-on-surface);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--md-sys-color-surface-container);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    flex: 1;
    padding: 8px 0;
}

.nav-icon-container {
    width: 64px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    margin-bottom: 4px;
    transition: background-color 0.2s ease;
}

.nav-icon {
    width: 24px;
    height: 24px;
    filter: var(--icon-filter);
    transition: filter 0.2s ease;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

.nav-item.active .nav-icon-container {
    background-color: var(--md-sys-color-secondary-container);
}

.nav-item.active .nav-icon {
    filter: var(--icon-active-filter);
}

.nav-item.active .nav-label {
    font-weight: 600;
    color: var(--md-sys-color-on-background);
}

/* Floating Controls (Search + FAB) */
.floating-controls {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px);
    right: 16px;
    left: 16px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    pointer-events: none; /* Let clicks pass through empty space */
    z-index: 50;
    gap: 16px;
}

.search-bar-container {
    flex: 1;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: right bottom;
}

.search-input {
    width: 100%;
    height: 56px;
    border-radius: 28px;
    border: none;
    padding: 0 24px;
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    font-size: 16px;
    font-family: inherit;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    outline: none;
}

.search-input:focus {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 0 0 2px var(--md-sys-color-primary);
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    pointer-events: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* Theme Switcher */
.theme-selector {
    display: flex;
    flex-direction: column;
    background-color: var(--md-sys-color-surface-container);
    border-radius: 16px;
    overflow: hidden;
}

.theme-btn {
    display: flex;
    align-items: center;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    text-align: left;
}

.theme-btn:last-child {
    border-bottom: none;
}

.theme-icon {
    width: 24px;
    height: 24px;
    margin-right: 16px;
    filter: var(--icon-filter);
}

.theme-label {
    flex: 1;
}

.check-icon {
    width: 24px;
    height: 24px;
    fill: var(--md-sys-color-primary);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.theme-btn.selected .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--md-sys-color-surface-container);
    border-radius: 28px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    max-height: min(60vh, 720px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 38px rgba(0,0,0,0.14), 0 9px 46px rgba(0,0,0,0.12), 0 11px 15px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-card h3 {
    margin-bottom: 24px;
    color: var(--md-sys-color-on-surface);
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.icon-picker-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    padding: 10px 8px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 12px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    text-align: center;
}

.icon-picker-option.selected {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-secondary-container);
}

.icon-picker-option img {
    width: 24px;
    height: 24px;
    filter: var(--icon-filter);
}

.modal-scroll-area {
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-scroll-area::-webkit-scrollbar {
    display: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 8px;
}

.modal-actions-sticky {
    position: sticky;
    bottom: 0;
    background-color: var(--md-sys-color-surface-container);
    padding-bottom: 4px;
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.modal-btn-cancel {
    background-color: transparent;
    color: var(--md-sys-color-primary);
}

.modal-btn-cancel:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.modal-btn-save {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.modal-btn-delete {
    background-color: #c62828;
    color: #ffffff;
}

/* Login Page Styles */
.login-body {
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background-color: var(--md-sys-color-surface-container);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.login-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle {
    font-size: 14px;
    color: var(--md-sys-color-outline);
    text-align: center;
    margin-bottom: 24px;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

.input-group input {
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--md-sys-color-outline);
    padding: 0 16px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.checkbox-group label {
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--md-sys-color-primary);
}

.login-btn {
    height: 48px;
    border-radius: 24px;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    font-size: 16px;
    font-weight: 600;
    margin-top: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.login-btn:active {
    transform: scale(0.98);
}

.login-error {
    background-color: #ffb4ab;
    color: #690005;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin-top: 24px;
    background-color: var(--md-sys-color-surface-variant);
    color: #ba1a1a;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.logout-btn:active {
    background-color: var(--md-sys-color-outline);
}

/* Custom Select for modals */
.custom-select {
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--md-sys-color-outline);
    padding: 0 16px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2374777F%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.custom-select:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
}

/* Instance Modal – Side-by-side inputs */
.input-group-row {
    display: flex;
    gap: 12px;
}

.input-group-row .input-group {
    margin-bottom: 0 !important;
}

.input-group-row .input-group:first-child {
    flex: 0 0 33.333%;
}

.input-group-row .input-group:last-child {
    flex: 0 0 66.666%;
}

.input-group-row .input-group input,
.input-group-row .input-group select {
    width: 100%;
}

/* Date input styling */
.date-input {
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--md-sys-color-outline);
    padding: 0 16px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

.date-input:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
}

.optional-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--md-sys-color-outline);
    margin-left: 4px;
}

/* Inventory Expandable List Item */
.inventory-card {
    padding: 0; /* padding applied to header and body instead */
    overflow: hidden;
}

.inventory-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
}

.inventory-card-main {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 12px;
}

.inventory-card-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: var(--icon-filter);
    flex-shrink: 0;
}

.inventory-card-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.inventory-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.expand-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    filter: var(--icon-filter);
}

.inventory-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.inventory-card-body {
    display: none;
    padding: 0 16px 16px 16px;
    border-top: 1px solid var(--md-sys-color-surface-variant);
    background-color: var(--md-sys-color-surface);
}

.inventory-card.expanded .inventory-card-body {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

/* ── Instance Rows ──────────────────────────────────────────────────────────── */

.instance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    gap: 8px;
}

.instance-row:last-of-type {
    border-bottom: none;
}

.instance-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.instance-name {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.instance-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.instance-qty {
    font-size: 13px;
    color: var(--md-sys-color-outline);
}

.instance-expiry {
    font-size: 13px;
    color: var(--md-sys-color-outline);
}

.instance-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.instance-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background-color: var(--md-sys-color-secondary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s ease;
}

.instance-action-btn img {
    width: 18px;
    height: 18px;
    filter: var(--icon-filter);
}

.instance-action-btn.delete {
    background-color: #ffe1e1;
}

.instance-action-btn.delete img {
    filter: brightness(0) saturate(100%) invert(20%) sepia(91%) saturate(2331%) hue-rotate(348deg) brightness(91%) contrast(98%);
}

/* Quick-add button in item header */
.instance-add-btn img {
    filter: var(--icon-filter);
}

/* Add Entry button at bottom of card body */
.add-entry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 0;
    border: 1.5px dashed var(--md-sys-color-outline);
    border-radius: 12px;
    background: transparent;
    color: var(--md-sys-color-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.add-entry-btn:hover {
    background-color: var(--md-sys-color-secondary-container);
    border-color: var(--md-sys-color-primary);
}

/* Changelog and notification modals */
.changelog-card {
    max-width: 520px;
    width: min(100%, 520px);
}

.modal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-close-btn {
    border: none;
    background: transparent;
    color: var(--md-sys-color-primary);
    font-weight: 600;
    cursor: pointer;
}

.changelog-card .modal-actions,
.notifications-card .modal-actions,
.changelog-card .modal-actions,
.modal-card .modal-actions {
    justify-content: flex-end;
}

.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Category Filter Dropdown ─────────────────────────────────────────────── */

.inventory-controls {
    margin-bottom: 16px;
    position: relative;
    z-index: 10;
}

.custom-dropdown {
    position: relative;
    width: 100%;
    border-radius: 12px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s ease;
}

.custom-dropdown.open {
    border-color: var(--md-sys-color-primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.dropdown-selected .dropdown-text {
    flex: 1;
    font-size: 16px;
    color: var(--md-sys-color-on-surface);
    font-weight: 500;
}

.dropdown-arrow {
    width: 20px;
    height: 20px;
    filter: var(--icon-filter);
    transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-primary);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.custom-dropdown.open .dropdown-options {
    display: block;
}

.dropdown-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    transition: background-color 0.15s ease;
}

.dropdown-option:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.dropdown-option.selected {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.dropdown-option-icon {
    width: 24px;
    height: 24px;
    filter: var(--icon-filter);
}

.dropdown-option-text {
    font-size: 15px;
}

.accordion-item {
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 12px;
    overflow: hidden;
    background: var(--md-sys-color-surface);
}

.accordion-header {
    width: 100%;
    border: none;
    background: transparent;
    padding: 14px 16px;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--md-sys-color-on-surface);
}

.accordion-icon {
    transition: transform 0.2s ease;
    font-size: 18px;
    line-height: 1;
    color: var(--md-sys-color-outline);
}

.accordion-header.active {
    background: var(--md-sys-color-secondary-container);
}

.accordion-header.active .accordion-icon {
    transform: rotate(90deg);
}

.accordion-body {
    display: none;
    padding: 0 16px 16px 16px;
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
}

.modal-card-content {
    padding-top: 8px;
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
}

.add-entry-btn img {
    width: 18px;
    height: 18px;
    filter: var(--icon-filter);
}

.instance-empty {
    padding: 12px 0;
    text-align: center;
}

.instance-loading {
    padding: 12px 0;
    text-align: center;
    font-style: italic;
}
