/* ═══════════════════════════════════════════════════════════════
   ACCOUNTS & LOGINS MODULE
   ═══════════════════════════════════════════════════════════════ */

/* ─── Header Add Button ─── */
.acl-header-add {
    display: inline-flex; align-items: center; gap: 5px;
    border: none; background: none;
    color: var(--system-blue);
    font-size: 13px; font-weight: 600;
    cursor: pointer; padding: 6px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    transition: background 0.15s;
}
.acl-header-add:hover { background: rgba(0,122,255,0.06); }
.acl-header-add .material-symbols-outlined { font-size: 18px; }

/* ─── Stats Strip ─── */
.acl-stats {
    display: flex; gap: 12px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.acl-stat-chip {
    flex: 1; min-width: 140px;
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(24px);
    border: 0.5px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.acl-stat-chip:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.acl-stat-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.03); flex-shrink: 0;
}
.acl-stat-icon .material-symbols-outlined { font-size: 18px; }
.acl-stat-info { display: flex; flex-direction: column; }
.acl-stat-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: var(--mono-ls-medium); }
.acl-stat-label { font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.02em; margin-top: 1px; }

/* ─── Toolbar (Search + Filter Pills) ─── */
.acl-toolbar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.acl-search-wrap {
    position: relative; flex: 1; min-width: 200px; max-width: 360px;
}
.acl-search-wrap .material-symbols-outlined {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 18px; color: var(--text-quaternary); pointer-events: none;
}
.acl-search-input {
    width: 100%; padding: 10px 12px 10px 38px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    font-size: 14px; font-family: var(--font-body);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.acl-search-input:focus {
    border-color: var(--system-blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}
.acl-search-input::placeholder { color: var(--text-quaternary); }

/* Filter pills (mobile: always visible, desktop: hidden) */
.acl-filter-pills {
    display: none;
    gap: 8px; flex-wrap: wrap;
}
.acl-filter-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px; border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s;
    font-family: var(--font-body);
    white-space: nowrap;
}
.acl-filter-pill:hover { background: rgba(0,0,0,0.04); }
.acl-filter-pill.active {
    background: var(--system-blue);
    color: #fff;
    border-color: var(--system-blue);
}
.acl-filter-pill .material-symbols-outlined { font-size: 14px; }

/* ─── Disclaimer ─── */
.acl-disclaimer {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: rgba(255,149,0,0.08);
    border: 1px solid rgba(255,149,0,0.15);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.4;
}
.acl-disclaimer .material-symbols-outlined { font-size: 18px; color: #FF9500; flex-shrink: 0; }
.acl-disclaimer-close {
    margin-left: auto; border: none; background: none;
    color: var(--text-quaternary); cursor: pointer;
    padding: 4px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.acl-disclaimer-close:hover { background: rgba(0,0,0,0.06); }
.acl-disclaimer-close .material-symbols-outlined { font-size: 16px; }
.acl-disclaimer.hidden { display: none; }

/* ─── Two-Column Layout ─── */
.acl-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}

/* ─── Sidebar (Category Nav) ─── */
.acl-sidebar {
    position: sticky; top: 80px;
    display: flex; flex-direction: column; gap: 2px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 0.5px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.acl-sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
}
.acl-sidebar-item:hover { background: rgba(0,0,0,0.04); }
.acl-sidebar-item.active {
    background: rgba(0,122,255,0.08);
    color: var(--system-blue);
    font-weight: 600;
}
.acl-sidebar-icon {
    width: 28px; height: 28px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.acl-sidebar-icon .material-symbols-outlined { font-size: 16px; color: #fff; }
.acl-sidebar-label { flex: 1; }
.acl-sidebar-count {
    font-size: 11px; font-weight: 600;
    color: var(--text-quaternary);
    min-width: 20px; text-align: right;
}

/* ─── Category Header (in list) ─── */
.acl-category-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 4px 8px;
    margin-top: 8px;
}
.acl-category-header:first-child { margin-top: 0; }
.acl-category-dot {
    width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}
.acl-category-name {
    font-size: 12px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}
.acl-category-count {
    font-size: 11px; color: var(--text-quaternary);
    margin-left: auto;
}

/* ─── Account Row ─── */
.acl-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--surface-1);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 0.5px solid rgba(0,0,0,0.04);
    border-radius: 14px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.acl-row:hover {
    background: var(--surface-2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transform: translateY(-1px);
}
.acl-row:active { transform: scale(0.995); transition: transform 80ms var(--ease-spring); }

/* Favicon */
.acl-favicon {
    width: 36px; height: 36px; border-radius: 10px;
    flex-shrink: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.03);
}
.acl-favicon img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 10px;
}
.acl-favicon-fallback {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}

/* Row info */
.acl-row-info { flex: 1; min-width: 0; }
.acl-row-name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acl-row-sub {
    font-size: 12px; color: var(--text-tertiary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 1px;
}
.acl-row-cost {
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    white-space: nowrap;
}
.acl-row-fav {
    border: none; background: none;
    cursor: pointer; padding: 4px;
    color: var(--text-quaternary);
    transition: color 0.15s;
    display: flex; align-items: center;
}
.acl-row-fav:hover { color: #FFB340; }
.acl-row-fav.active { color: #FFB340; }
.acl-row-fav .material-symbols-outlined { font-size: 18px; }
.acl-row-chevron {
    color: var(--text-quaternary);
    display: flex; align-items: center;
}
.acl-row-chevron .material-symbols-outlined { font-size: 18px; }

/* ─── Editor Overlay ─── */
.acl-editor-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 6000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.acl-editor-overlay.active {
    opacity: 1; pointer-events: all;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.acl-editor-panel {
    width: 100%; max-width: 480px;
    max-height: calc(100vh - 48px); overflow-y: auto;
    background: #F5F5F7;
    border-radius: 20px;
    corner-shape: squircle;
    box-shadow: 0 24px 80px rgba(0,0,0,0.16), 0 0 0 0.5px rgba(0,0,0,0.04);
    transform: scale(0.94) translateY(8px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.18s ease-out;
    display: flex; flex-direction: column;
}
.acl-editor-overlay.active .acl-editor-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Editor header */
.acl-editor-header {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.acl-editor-close {
    border: none; background: rgba(0,0,0,0.05);
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary);
    transition: background 0.15s;
}
.acl-editor-close:hover { background: rgba(0,0,0,0.1); }
.acl-editor-close .material-symbols-outlined { font-size: 18px; }
.acl-editor-title {
    font-size: 17px; font-weight: 700; color: var(--text-primary);
    flex: 1;
}

/* Editor body */
.acl-editor-body {
    flex: 1; padding: 20px 24px;
    display: flex; flex-direction: column; gap: 16px;
    overflow-y: auto;
}

/* Favicon preview */
.acl-editor-favicon-preview {
    display: flex; align-items: center; gap: 14px;
    padding-bottom: 8px;
}
.acl-editor-favicon-preview .acl-favicon,
.acl-editor-favicon-preview .acl-favicon-fallback {
    width: 48px; height: 48px; border-radius: 12px; font-size: 20px;
}
.acl-editor-favicon-preview .acl-favicon img { border-radius: 12px; }

/* Form fields */
.acl-field { display: flex; flex-direction: column; gap: 4px; }
.acl-field-label {
    font-size: 12px; font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.03em;
}
.acl-field-input {
    padding: 10px 12px;
    border: 1.5px solid var(--glass-border);
    border-radius: 10px;
    corner-shape: squircle;
    background: var(--glass-bg);
    font-size: 14px; font-family: var(--font-body);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.acl-field-input:focus {
    border-color: var(--system-blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}
.acl-field-input::placeholder { color: var(--text-quaternary); }
select.acl-field-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%238E8E93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
textarea.acl-field-input { resize: vertical; min-height: 60px; }

/* Password field with toggle + copy */
.acl-password-wrap {
    display: flex; align-items: center; gap: 4px;
}
.acl-password-wrap .acl-field-input {
    flex: 1; font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.acl-pw-btn {
    border: none; background: none;
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-tertiary);
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.acl-pw-btn:hover { background: rgba(0,0,0,0.06); color: var(--text-secondary); }
.acl-pw-btn .material-symbols-outlined { font-size: 18px; }

/* Copy button for username */
.acl-copy-btn {
    border: none; background: none;
    padding: 6px; border-radius: 6px;
    cursor: pointer; color: var(--text-quaternary);
    display: flex; align-items: center;
    transition: background 0.15s, color 0.15s;
}
.acl-copy-btn:hover { background: rgba(0,0,0,0.05); color: var(--system-blue); }
.acl-copy-btn .material-symbols-outlined { font-size: 16px; }

/* Row layout for side-by-side fields */
.acl-field-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

/* Tags */
.acl-tags-wrap {
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.acl-tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0,122,255,0.08);
    color: var(--system-blue);
    font-size: 11px; font-weight: 600;
}
.acl-tag-remove {
    border: none; background: none; cursor: pointer;
    color: var(--system-blue); opacity: 0.5;
    font-size: 12px; padding: 0 2px;
    display: flex; align-items: center;
}
.acl-tag-remove:hover { opacity: 1; }
.acl-tag-add {
    border: 1px dashed var(--glass-border);
    background: none; border-radius: 6px;
    padding: 3px 8px; font-size: 11px;
    color: var(--text-quaternary); cursor: pointer;
    font-family: var(--font-body);
    transition: border-color 0.15s, color 0.15s;
}
.acl-tag-add:hover { border-color: var(--system-blue); color: var(--system-blue); }

/* Linked bill pill */
.acl-linked-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px;
    background: rgba(52,199,89,0.10);
    border: 1px solid rgba(52,199,89,0.18);
    border-radius: 8px;
    font-size: 12px; font-weight: 600;
    color: #34C759;
}
.acl-linked-pill .material-symbols-outlined { font-size: 14px; }
.acl-no-linked-pill {
    font-size: 12px; color: var(--text-quaternary); font-style: italic;
}

/* Last updated */
.acl-last-updated {
    font-size: 11px; color: var(--text-quaternary);
    text-align: center; padding-top: 8px;
    border-top: 1px solid var(--glass-border);
}

/* Editor footer */
.acl-editor-footer {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.acl-editor-footer .btn { flex: 1; }
.acl-editor-delete {
    border: none; background: none;
    color: var(--system-red);
    font-size: 13px; font-weight: 600;
    cursor: pointer; padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    transition: background 0.15s;
}
.acl-editor-delete:hover { background: rgba(255,59,48,0.06); }

/* ─── Empty State ─── */
.acl-empty {
    text-align: center; padding: 60px 20px;
    color: var(--text-tertiary);
}
.acl-empty-icon {
    font-size: 48px; color: var(--text-quaternary);
    margin-bottom: 12px;
}
.acl-empty-title {
    font-size: 17px; font-weight: 700; color: var(--text-secondary);
    margin-bottom: 4px;
}
.acl-empty-desc {
    font-size: 13px; color: var(--text-tertiary);
    max-width: 280px; margin: 0 auto 16px;
}

/* Ghost rows (shimmer) */
.acl-ghost-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--surface-1);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: 14px;
    margin-bottom: 6px;
    opacity: 0.4;
}
.acl-ghost-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.05) 75%);
    background-size: 200% 100%;
    animation: aclShimmer 1.5s ease-in-out infinite;
}
.acl-ghost-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.acl-ghost-line {
    height: 10px; border-radius: 5px;
    background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.05) 75%);
    background-size: 200% 100%;
    animation: aclShimmer 1.5s ease-in-out infinite;
}
.acl-ghost-line:first-child { width: 60%; }
.acl-ghost-line:last-child { width: 40%; }

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

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .acl-layout {
        grid-template-columns: 1fr;
    }
    .acl-sidebar { display: none; }
    .acl-filter-pills { display: flex; }
    .acl-search-wrap { max-width: 100%; }
    .acl-editor-panel { max-width: calc(100vw - 32px); }
    .acl-field-row { grid-template-columns: 1fr; }
    .acl-stats { gap: 8px; }
    .acl-stat-chip { min-width: 120px; padding: 12px 14px; }
}

@media (max-width: 768px) {
    .acl-editor-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .acl-editor-panel {
        max-width: 100%;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
    }
}

@media (max-width: 480px) {
    .acl-stat-chip { min-width: 0; flex-basis: calc(50% - 4px); }
    .acl-editor-body { padding: 16px 18px; }
    .acl-editor-header { padding: 16px 18px 12px; }
    .acl-editor-footer { padding: 12px 18px 16px; }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    .acl-editor-overlay,
    .acl-editor-panel,
    .acl-row,
    .acl-stat-chip,
    .acl-ghost-avatar,
    .acl-ghost-line {
        transition: none;
        animation: none;
    }
}
