@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #52525b;
    --border-color: #e2e8f0;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    --bg-page: #0f172a;
    --bg-surface: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #a1a1aa; /* Lighter for dark theme but still readable */
    --border-color: #334155;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.3;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Card Utility */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.25);
}

/* Inputs & Forms */
.form-group-app {
    margin-bottom: 1rem;
}

.label-app {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.input-app {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.input-app:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.input-app::placeholder {
    color: #52525b;
}

/* Buttons */
.btn-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.btn-app:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-primary-app {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary-app:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary-app:active {
    transform: translateY(0);
}

.btn-secondary-app {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary-app:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* Auth Layout */
.auth-wrapper-app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--bg-page);
}

.auth-box-app {
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    background: var(--bg-surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: fadeInSlideUp 0.4s ease forwards;
}

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-section-app {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-section-app h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.brand-section-app p {
    color: var(--text-muted);
}

/* Alerts */
.app-alert-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #fecaca;
    font-size: 0.875rem;
    text-align: center;
}

.app-alert-success {
    background: #ecfdf5;
    color: var(--success);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #a7f3d0;
    font-size: 0.875rem;
    text-align: center;
}

/* Utilities */
.hidden { display: none !important; }
.text-danger-app { color: var(--danger) !important; }
.mt-6 { margin-top: 1.5rem !important; }

/* Shared page sections */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-card {
    padding: 0;
    overflow: hidden;
    border: none;
    box-shadow: var(--shadow-md);
}

.icon-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.icon-link-muted {
    color: var(--text-muted);
    transition: 0.2s;
}

.icon-link-danger {
    color: var(--danger);
    transition: 0.2s;
}

.inline-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.inline-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    font-size: 0.65rem;
    padding: 2px 6px;
    margin-left: 5px;
}

/* Login page */
.theme-toggle-floating {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
}

.auth-box-compact {
    max-width: 400px;
    padding: 2.5rem;
}

.brand-section-left {
    margin-bottom: 2.5rem;
    text-align: left;
}

.full-width {
    width: 100%;
}

/* ── Search Bar / Input-like Controls ─────────────────────────────── */
.search-bar {
    padding: 0.55rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-bar::placeholder {
    color: var(--text-muted);
}

/* ── Status Badges ─────────────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Active / New */
.status-new {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Default / Inactive */
.status-default {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}

/* Warning */
.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Danger */
.status-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ── Table Styles (used by dashboard pages) ────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] thead {
    background: rgba(255, 255, 255, 0.03);
}

th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: rgba(37, 99, 235, 0.03);
}

/* ── User Avatar ───────────────────────────────────────────────────── */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ── App Footer ────────────────────────────────────────────────────── */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 3rem;
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.footer-separator {
    opacity: 0.4;
}

/* ── Responsive & Mobile UI Polish ─────────────────────────────────── */
@media (max-width: 768px) {
    /* Premium Geometric Typography */
    body {
        font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        background: radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.07), transparent 350px),
                    radial-gradient(circle at 10% 80%, rgba(59, 130, 246, 0.07), transparent 350px),
                    var(--bg-page) !important;
    }

    /* Slick Page Load Animation */
    .main-content {
        animation: premiumSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both !important;
    }

    @keyframes premiumSlideUp {
        from {
            opacity: 0;
            transform: translateY(12px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* High-End Frosted Glass Cards (Glassmorphism) */
    .glass-card,
    div[class*="glass-card"],
    .glass-card[style],
    .stat-card,
    .modal-box,
    .drawer {
        background: rgba(255, 255, 255, 0.75) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border: 1px solid rgba(255, 255, 255, 0.6) !important;
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04) !important;
        border-radius: 16px !important;
        padding: 1.25rem !important;
        margin-bottom: 1.25rem !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .glass-card:hover,
    div[class*="glass-card"]:hover,
    .stat-card:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.07) !important;
        border-color: rgba(99, 102, 241, 0.25) !important;
    }

    /* Dark Mode Glassmorphism Override */
    [data-theme="dark"] .glass-card,
    [data-theme="dark"] div[class*="glass-card"],
    [data-theme="dark"] .glass-card[style],
    [data-theme="dark"] .stat-card,
    [data-theme="dark"] .modal-box,
    [data-theme="dark"] .drawer {
        background: rgba(30, 41, 59, 0.7) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
    }

    [data-theme="dark"] .glass-card:hover,
    [data-theme="dark"] div[class*="glass-card"]:hover,
    [data-theme="dark"] .stat-card:hover {
        border-color: rgba(96, 165, 250, 0.25) !important;
    }

    /* Glowing Gradient Primary Buttons */
    .btn-primary-app,
    .btn-save-master,
    .btn-action-primary,
    button[type="submit"]:not(.wa-send-btn) {
        background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%) !important;
        border: none !important;
        color: white !important;
        box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.35) !important;
        font-weight: 700 !important;
        letter-spacing: 0.02em !important;
        border-radius: 10px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .btn-primary-app:hover,
    .btn-save-master:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px 0 rgba(79, 70, 229, 0.45) !important;
        filter: brightness(1.1) !important;
    }

    /* Organic input styles */
    .input-app,
    .search-bar,
    .filter-select {
        background: rgba(255, 255, 255, 0.6) !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
        box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.01) !important;
        border-radius: 10px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .input-app:focus,
    .search-bar:focus,
    .filter-select:focus {
        border-color: #4f46e5 !important;
        background: #ffffff !important;
        box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12) !important;
    }

    [data-theme="dark"] .input-app,
    [data-theme="dark"] .search-bar,
    [data-theme="dark"] .filter-select {
        background: rgba(15, 23, 42, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    [data-theme="dark"] .input-app:focus,
    [data-theme="dark"] .search-bar:focus,
    [data-theme="dark"] .filter-select:focus {
        background: rgba(15, 23, 42, 0.8) !important;
        border-color: #60a5fa !important;
        box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15) !important;
    }

    /* Stack grid forms on mobile */
    .grid-form {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .grid-span-2 {
        grid-column: span 1 !important;
    }

    /* Polish table scrollability & thin scrollbars */
    .table-container {
        border-radius: 8px !important;
        margin: 0 -0.5rem; /* slight overflow correction */
    }

    .table-container::-webkit-scrollbar,
    .glass-card::-webkit-scrollbar {
        height: 6px !important;
    }

    .table-container::-webkit-scrollbar-thumb,
    .glass-card::-webkit-scrollbar-thumb {
        background-color: var(--border-color) !important;
        border-radius: 10px !important;
    }

    /* Ultra-Premium Card-Row Table layout override on mobile */
    table {
        border-collapse: separate !important;
        border-spacing: 0 0.6rem !important;
        min-width: 100% !important;
    }

    tr {
        border: none !important;
        background: transparent !important;
    }

    th {
        padding: 0.5rem 1rem !important;
        border: none !important;
        font-size: 0.75rem !important;
    }

    td {
        border: none !important;
        background: rgba(255, 255, 255, 0.45) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
        padding: 1rem 1.25rem !important;
        transition: all 0.2s ease !important;
    }

    td:first-child {
        border-left: 1px solid rgba(255, 255, 255, 0.5) !important;
        border-top-left-radius: 12px !important;
        border-bottom-left-radius: 12px !important;
    }

    td:last-child {
        border-right: 1px solid rgba(255, 255, 255, 0.5) !important;
        border-top-right-radius: 12px !important;
        border-bottom-right-radius: 12px !important;
    }

    [data-theme="dark"] td {
        background: rgba(30, 41, 59, 0.4) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    }

    [data-theme="dark"] td:first-child {
        border-left: 1px solid rgba(255, 255, 255, 0.04) !important;
    }

    [data-theme="dark"] td:last-child {
        border-right: 1px solid rgba(255, 255, 255, 0.04) !important;
    }

    tbody tr:hover td {
        background: rgba(79, 70, 229, 0.06) !important;
        border-color: rgba(79, 70, 229, 0.2) !important;
    }

    /* Auto-enable horizontal swipe zones on cards that wrap tables directly */
    .glass-card:has(table),
    div[class*="glass-card"]:has(table) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Clean spacing for stats grid on tablets/phones */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
        gap: 0.75rem !important;
    }

    /* Stack all inline desktop grids and two-column layouts automatically on mobile */
    div[style*="grid-template-columns"],
    form[style*="grid-template-columns"],
    .dashboard-two-col {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    /* Stack any element that uses display: flex with justify-content: space-between inside main-content (excluding header) */
    .main-content div[style*="display: flex"][style*="justify-content: space-between"]:not(.header):not(.header div),
    .main-content div[style*="display:flex"][style*="justify-content:space-between"]:not(.header):not(.header div) {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .main-content div[style*="display: flex"]:not(.header):not(.header div),
    .main-content div[style*="display:flex"]:not(.header):not(.header div) {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    /* Force global two-column grid sections to stack vertically on mobile */
    .grid-2 {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1.25rem !important;
    }

    /* Global page padding reduction */
    .main-content {
        padding: 1.25rem 1rem !important;
    }

    /* Footer responsiveness */
    .app-footer {
        flex-direction: column !important;
        padding: 1.5rem 1rem !important;
        gap: 0.5rem !important;
        text-align: center;
    }

    .footer-separator {
        display: none !important;
    }
}

@media (max-width: 640px) {
    /* Auth wrapper & containers */
    .auth-wrapper-app {
        padding: 1rem !important;
        align-items: flex-start !important;
        padding-top: 3rem !important;
    }

    .auth-box-app,
    .auth-box-compact {
        padding: 1.5rem !important;
        border-radius: 12px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .brand-section-app {
        margin-bottom: 1.75rem !important;
    }

    .brand-section-app h1 {
        font-size: 1.75rem !important;
    }

    /* Page toolbars optimization (Search / Filters / Buttons) */
    .page-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .toolbar-group {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 0.75rem !important;
    }

    /* Stretch toolbar controls (inputs, selects, buttons) to full width */
    .page-toolbar .toolbar-group input,
    .page-toolbar .toolbar-group select,
    .page-toolbar .toolbar-group a,
    .page-toolbar .toolbar-group button,
    .search-bar,
    .filter-select {
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    .btn-app {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.88rem !important;
        justify-content: center !important;
    }

    /* Keep filter pill buttons and small secondary inline buttons at auto width on mobile */
    .btn-secondary-app,
    [id^="filter-"] {
        width: auto !important;
        flex: initial !important;
        display: inline-flex !important;
        padding: 0.3rem 0.9rem !important;
    }

    /* Expire list filter bar vertical stacking */
    .filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }

    .filter-item {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Make buttons and view switcher switchers full-width and balanced on phone viewports */
    .view-switcher {
        width: 100% !important;
        margin: 0 !important;
        justify-content: space-around !important;
    }
    
    .view-switcher button {
        flex: 1 !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* Reset spacing drifts on mobile flex layouts inside main content */
    .main-content div[style*="display: flex"]:not(.header):not(.header div),
    .main-content div[style*="display:flex"]:not(.header):not(.header div) {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Stack form action buttons (Save / Cancel rows) vertically at the bottom of forms */
    .glass-card form div[style*="display: flex"],
    div[class*="glass-card"] form div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .glass-card form div[style*="display: flex"] > button,
    .glass-card form div[style*="display: flex"] > a,
    div[class*="glass-card"] form div[style*="display: flex"] > button,
    div[class*="glass-card"] form div[style*="display: flex"] > a {
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        justify-content: center !important;
    }

    /* Make Lead Drawer full width on phone screens */
    .drawer {
        width: 100% !important;
    }

    /* Refine modals on phones */
    .modal-box {
        padding: 1.25rem !important;
        max-width: 92% !important;
        margin: 0 auto !important;
    }

    /* Inline elements and inputs next to dropdowns (like the plus button in sellers/add.ejs) */
    .form-group-app > div[style*="flex"] {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .btn-plus-inline {
        width: 100% !important;
        height: 42px !important;
        margin-top: 0.25rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}

/* ── Transaction Items Grid ─────────────────────────────────────────── */
/* 8 columns: Product | Group | Plan | Data Date | From | To | Price | Action */
.items-scroll-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.items-table {
    min-width: 960px;
    width: 100%;
}

/* Shared column template for both header and data rows */
.items-header-row,
.item-row-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.1fr 130px 130px 130px 100px 36px;
    gap: 0.5rem;
    align-items: center;
}

/* Header row styling */
.items-header-row {
    padding: 0 0.25rem 0.6rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.header-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    padding: 0 0.15rem;
}

/* Each data row */
.item-row-grid {
    padding: 0.4rem 0.25rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.item-row-grid:hover {
    background: rgba(37, 99, 235, 0.03);
}

[data-theme="dark"] .item-row-grid:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Inputs inside the grid cells */
.input-item-app {
    width: 100%;
    padding: 0.5rem 0.6rem;
    font-size: 0.84rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.input-item-app:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .input-item-app {
    background: rgba(15, 23, 42, 0.4);
}

/* Action cell (remove button) */
.action-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--danger, #ef4444);
    cursor: pointer;
    font-size: 1.05rem;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.btn-remove-item:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    transform: scale(1.1);
}

/* Separator between rows */
.item-row-grid + .item-row-grid {
    border-top: 1px solid var(--border-color);
    padding-top: 0.6rem;
    margin-top: 0.25rem;
}
