/* =========================================================================
   BUTTONS + INPUTS
   ========================================================================= */
button {
    padding: 11px 18px;
    min-height: 44px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

button:hover { background: var(--accent-2); }
button:active { transform: scale(0.97); }
button:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; transform: none; }
button.secondary { background: var(--surface-2); color: var(--text); }
button.secondary:hover { background: var(--surface-3); }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }

button.sm {
    padding: 8px 14px;
    min-height: 36px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.icon-btn {
    background: transparent;
    color: var(--text-2);
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    touch-action: manipulation;
}

.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.icon-btn.active { color: var(--accent); }

input[type="text"] {
    padding: 12px 16px;
    min-height: 44px;
    /* Keep >=16px so iOS Safari never zooms the viewport on focus. */
    font-size: 16px;
    background: var(--surface);
    border: 1px solid transparent;
    color: var(--text);
    border-radius: var(--radius);
    width: 100%;
    transition: border-color 0.15s, background 0.15s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-2);
}

/* Search field with icon */
.search-field {
    position: relative;
    width: 100%;
}

.search-field .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.search-field input[type="text"] {
    padding-left: 40px;
    padding-right: 40px;
}

.search-field .clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface-3);
    color: var(--text-2);
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
}

/* Checkboxes */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s var(--ease-out);
}

input[type="checkbox"]:hover {
    border-color: var(--accent);
    background: rgba(20, 184, 166, 0.1);
}

input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: checkPop 0.2s var(--ease-spring);
}

@keyframes checkPop {
    0% { opacity: 0; transform: rotate(45deg) scale(0.5); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

/* =========================================================================
   TOOLBAR
   ========================================================================= */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.toolbar button,
.toolbar > input { width: 100%; }

/* =========================================================================
   BOTTOM NAV
   ========================================================================= */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    background: rgba(10, 10, 14, 0.88);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    z-index: 45;
}

.bn-tab {
    flex: 1;
    background: transparent;
    color: var(--text-3);
    padding: 8px 4px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 0;
    font-size: 0.68rem;
    font-weight: 600;
    transition: color 0.15s;
}

.bn-tab span {
    font-size: 0.68rem;
    letter-spacing: -0.01em;
}

.bn-tab:hover { background: transparent; color: var(--text-2); }
.bn-tab.active { color: var(--accent); }
.bn-tab.active svg { filter: drop-shadow(0 0 8px var(--accent-glow)); }
.bn-tab:active svg { transform: scale(0.88); transition: transform 0.1s; }
