/* ===========================
   Materials Page — shadcn UI
   =========================== */

/* Batch Settings */
.batch-settings {
    border-top: 2px solid var(--primary);
}

.markup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

/* Import Section */
.import-section {
    border-top: 2px solid var(--info, #3b82f6);
}

.import-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: start;
}

.import-instructions {
    background: var(--background, #09090b);
    border: 1px solid var(--border, #27272a);
    border-radius: var(--radius, 0.5rem);
    padding: 1rem;
}

.import-instructions h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--foreground, #fafafa);
}

.import-instructions ul {
    list-style: none;
    padding: 0;
}

.import-instructions li {
    font-size: 0.8125rem;
    color: var(--muted-foreground, #a1a1aa);
    padding: 0.25rem 0;
    line-height: 1.4;
}

.import-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.file-info {
    font-size: 0.75rem;
    color: var(--muted-foreground, #a1a1aa);
}

/* Single Material Form */
.add-material-section {
    border-top: 2px solid var(--success, #22c55e);
}

.single-material-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group-inline label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground, #a1a1aa);
}

.form-group-inline input {
    padding: 0.5rem 0.75rem;
    background: var(--background, #09090b);
    border: 1px solid var(--input, #27272a);
    border-radius: var(--radius, 0.5rem);
    color: var(--foreground, #fafafa);
    font-size: 0.8125rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition, all 0.15s ease);
    outline: none;
}

.form-group-inline input:focus {
    border-color: var(--ring, #ed1a3b);
    box-shadow: 0 0 0 2px rgba(237, 26, 59, 0.2);
}

/* Material Table Specifics */
.material-table .editable-cell {
    cursor: pointer;
    position: relative;
}

.material-table .editable-cell:hover {
    background: rgba(237, 26, 59, 0.06);
}

.material-table .editable-cell input {
    width: 80px;
    padding: 0.25rem 0.5rem;
    background: var(--background, #09090b);
    border: 1px solid var(--ring, #ed1a3b);
    border-radius: calc(var(--radius, 0.5rem) / 2);
    color: var(--foreground, #fafafa);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    box-shadow: 0 0 0 2px rgba(237, 26, 59, 0.2);
}

/* Color Dot */
.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border, #27272a);
    display: inline-block;
    cursor: pointer;
}

/* Row Highlight Colors — light pastels for consistent dark text */
.row-highlight-blue td {
    background: #dbeafe !important;
}

.row-highlight-yellow td {
    background: #fef9c3 !important;
}

.row-highlight-gray td {
    background: #e5e7eb !important;
}

.row-highlight-silver td {
    background: #f1f5f9 !important;
}

.row-highlight-gold td {
    background: #fef3c7 !important;
}

.row-highlight-green td {
    background: #dcfce7 !important;
}

.row-highlight-red td {
    background: #fee2e2 !important;
}

.row-highlight-purple td {
    background: #f3e8ff !important;
}

/* Ensure text stays dark on colored rows */
.row-highlight-blue td,
.row-highlight-yellow td,
.row-highlight-gray td,
.row-highlight-silver td,
.row-highlight-gold td,
.row-highlight-green td,
.row-highlight-red td,
.row-highlight-purple td {
    color: #1e293b !important;
}

.row-highlight-blue td strong,
.row-highlight-yellow td strong,
.row-highlight-gray td strong,
.row-highlight-silver td strong,
.row-highlight-gold td strong,
.row-highlight-green td strong,
.row-highlight-red td strong,
.row-highlight-purple td strong {
    color: #0f172a !important;
}

/* Calculator Modal Styles */
.calculator-field {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.calculator-field input {
    flex: 1;
}

.calculator-result {
    padding: 1rem;
    background: var(--background, #09090b);
    border: 1px solid var(--border, #27272a);
    border-radius: var(--radius, 0.5rem);
    margin-top: 0.75rem;
}

.calculator-result .total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary, #ed1a3b);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    .import-container {
        grid-template-columns: 1fr;
    }

    .markup-grid {
        grid-template-columns: 1fr 1fr;
    }

    .single-material-form .form-row {
        grid-template-columns: 1fr 1fr;
    }
}