.app-grid {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    overflow: hidden;
}

.app-grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.app-grid-group,
.app-grid-pager label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #64748b;
    font-size: 0.82rem;
}

.app-grid-group select,
.app-grid-pager select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.25rem 0.45rem;
    background: #fff;
}

.app-grid-add {
    border: 0;
    background: var(--et-header-gold, #00008b);
    color: #fff;
    border-radius: 8px;
    padding: 0.32rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.app-grid-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.app-grid-tool {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 0.32rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.app-grid-tool:hover { background: #f8fafc; }

.app-grid-export {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.app-grid-export svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-grid-export.excel svg { color: #15803d; }
.app-grid-export.pdf svg { color: #b91c1c; }
.app-grid-export.print svg { color: #1e3a8a; }

.app-grid-export.excel:hover { border-color: #86efac; background: #f0fdf4; }
.app-grid-export.pdf:hover { border-color: #fca5a5; background: #fef2f2; }
.app-grid-export.print:hover { border-color: #93c5fd; background: #eff6ff; }

.app-grid-columns { position: relative; }

.app-grid-pop,
.app-grid-filter-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 8;
    min-width: 180px;
    padding: 0.65rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.app-grid-pop {
    display: grid;
    gap: 0.4rem;
    max-height: min(70vh, 28rem);
    overflow: auto;
}

.app-grid-pop strong {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.app-grid-pop label {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.84rem;
}

.app-grid-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.65rem 0.9rem 0;
}

.app-grid-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0.2rem 0.35rem 0.2rem 0.7rem;
    font-size: 0.8rem;
    color: #334155;
    background: #fff;
}

.app-grid-chip button {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.app-grid-table-wrap { overflow: auto; }

.app-grid-table {
    width: 100%;
    border-collapse: collapse;
}

.app-grid-table th,
.app-grid-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    font-size: 0.88rem;
    vertical-align: middle;
    white-space: nowrap;
}

.app-grid-table th {
    position: relative;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    background: #fff;
}

.app-grid-table tbody tr:hover { background: #f8fafc; }
.app-grid-table tbody tr.selected { background: #f1f5ff; }

.app-grid-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.app-grid-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
}

.app-grid-table th.num .app-grid-head {
    flex-direction: row-reverse;
}

.app-grid-table th.num .app-grid-sort {
    text-align: right;
}

.app-grid-table tfoot td {
    font-weight: 700;
    color: #0f172a;
    background: #f1f5ff;
    border-top: 2px solid #c7d2fe;
    border-bottom: 0;
}

.app-grid-sort {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
}

.app-grid-sort:disabled { cursor: default; }

.app-grid-filter {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    border-radius: 6px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.app-grid-filter.open,
.app-grid-filter:hover { background: #f1f5f9; color: #334155; }

.app-grid-filter svg { width: 12px; height: 12px; }

.app-grid-filter-pop {
    left: 0;
    right: auto;
    min-width: 220px;
}

.app-grid-filter-pop input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
}

.app-grid-filter-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.app-grid-check { width: 42px; }

.app-grid-expand { width: 36px; }

.app-grid-expand-btn {
    border: 0;
    background: transparent;
    color: #334155;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.app-grid-expand-btn:hover { background: #f1f5f9; }

.app-grid-table tr.expanded { background: #f8fafc; }

.app-grid-detail td {
    background: #f8fafc;
    padding: 0.35rem 0.9rem 0.9rem 2.6rem;
}

.app-grid-group-row td {
    background: #fafafa;
    font-weight: 600;
    color: #334155;
}

.app-grid-group-row button {
    border: 0;
    background: transparent;
    margin-right: 0.4rem;
    cursor: pointer;
}

.app-grid-group-row small {
    margin-left: 0.45rem;
    color: #94a3b8;
    font-weight: 500;
}

.app-grid-actions {
    width: 88px;
    text-align: right;
}

.app-grid-editor input,
.app-grid-editor select {
    width: 100%;
    min-width: 72px;
    border: 1px solid #dbe3f0;
    border-radius: 6px;
    padding: 0.35rem 0.45rem;
    font: inherit;
}

.app-grid-table tr.editing {
    background: #f8fafc;
}

.app-grid-error {
    margin: 0 0.9rem 0.6rem;
}

.app-grid-icon {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: #1f2937;
    color: #fff;
    margin-left: 0.25rem;
    cursor: pointer;
}

.app-grid-icon.save { background: #16a34a; }
.app-grid-icon.cancel { background: #64748b; }

.app-grid-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    color: #64748b;
    font-size: 0.82rem;
}

.app-grid-pages { display: flex; gap: 0.25rem; }

.app-grid-pages button {
    min-width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
}

.app-grid-pages button.active,
.app-grid-pages button:hover:not(:disabled) { background: #eef2ff; }

.app-grid-pages button:disabled { color: #cbd5e1; cursor: default; }

.app-grid-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.app-grid-status i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.app-grid-status.ok i { background: #16a34a; }
.app-grid-status.stop i { background: #dc2626; }

.app-grid-stock {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 160px;
}

.app-grid-stock b {
    display: block;
    width: 72px;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.app-grid-stock b i {
    display: block;
    height: 100%;
    background: #4f46e5;
}

.app-grid-stock span { color: #64748b; font-size: 0.8rem; }
