﻿body {
    margin: 0;
    font-family: 'Segoe UI',system-ui,sans-serif;
    background: var(--bg);
    color: var(--text-primary);
}

/*CARD*/
.master-card {
    border-radius: 16px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    box-shadow: none;
    transition: all .25s ease;
}

    .master-card:hover {
        box-shadow: 0 8px 24px color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent);
    }


/* ===========================================================
   FORM PANEL — collapsible header + toggle
   =========================================================== */
.master-form-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: clamp(8px, 1.5vw, 14px) clamp(12px, 2.5vw, 20px);
    user-select: none;
}

/* For laptop screens and below */
@media (max-width: 1440px) {
    .master-form-toggle {
        padding: 8px 12px;
    }
}

/* For mobile viewports */
@media (max-width: 600px) {
    .master-form-toggle {
        padding: 8px 12px;
    }
}


    .master-form-toggle:hover {
        background: var(--mud-palette-action-default-hover);
    }

.master-form-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.master-form-toggle-icon {
    transition: transform .2s ease;
}

    .master-form-toggle-icon.open {
        transform: rotate(180deg);
    }

.master-form-body {
    padding: 4px 20px 20px;
    border-top: 1px solid var(--mud-palette-lines-default);
}


/*---------------------------------------------------------------------------------------------------------*/
/*Section Header*/
/*---------------------------------------------------------------------------------------------------------*/
.master-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.master-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.master-count {
    color: var(--mud-palette-text-secondary);
    font-size: .85rem;
}

.master-count {
    color: var(--mud-palette-text-secondary);
    font-size: .82rem;
    font-weight: 400;
    background: var(--mud-palette-action-default-hover);
    border-radius: 999px;
    padding: 2px 10px;
}

.master-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 16px;
}

.master-search {
    flex: 1;
    max-width: 260px;
    
}

    /* Target the clear button wrapper and icon inside MudTextField */
    .master-search .mud-input-clear-button .mud-icon-root {
        color: #6b7280; /* neutral gray */
        transition: color 0.2s ease;
    }

    .master-search .mud-input-clear-button:hover .mud-icon-root {
        color: #3b82f6 !important; /* primary blue on hover */
    }



.mud-input-outlined-border {
        border-radius: 12px !important
    }




.master-filter-chip {
    border-radius: 999px !important;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 13px;
    cursor: pointer;
}

/*---------------------------------------------------------------------------------------------------------*/
/*Section Header*/
/*---------------------------------------------------------------------------------------------------------*/
.master-form {
    margin-top: 10px;
}

.master-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}



/*---------------------------------------------------------------------------------------------------------*/
/*Data Grid*/
/*---------------------------------------------------------------------------------------------------------*/

.master-grid {
    border-radius: 0 0 16px 16px;
}

    .master-grid .mud-table-head th {
        text-transform: uppercase;
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: .08em;
        color: var(--mud-palette-text-secondary);
    }

        /* Hide per-column filter icons by default; only reveal on header hover */
        .master-grid .mud-table-head th .mud-table-sort-label-icon,
        .master-grid .mud-table-head th button {
            opacity: 0;
            transition: opacity .15s ease;
        }

        .master-grid .mud-table-head th:hover button {
            opacity: 1;
        }

    .master-grid .mud-table-row {
        transition: background .15s ease;
    }

        .master-grid .mud-table-row:hover {
           
            background: color-mix(in srgb, var(--mud-palette-primary) 6%, transparent);
        }


/* Row action icon — hidden until row hover */
.master-row-action {
    opacity: 0;
    transition: opacity .15s ease;
}

.master-table-row:hover .master-row-action,
.mud-table-row:hover .master-row-action {
    opacity: 1;
}

/* Lock icon on protected rows stays visible at all times — it's a
   permanent status indicator, not a hover-revealed action like Edit */
/*.master-row-action-locked {
    opacity: .6 !important;
}*/

/*---------------------------------------------------------------------------------------------------------*/
/*System / Locked Row*/
/*---------------------------------------------------------------------------------------------------------*/
.master-row-system {
    /* was rgba(255,193,7,.10) + #FFC107 — derive from the theme's warning color */
    background: color-mix(in srgb, var(--mud-palette-warning) 10%, transparent) !important;
    border-left: 4px solid var(--mud-palette-warning);
}

    .master-row-system:hover {
        background: color-mix(in srgb, var(--mud-palette-warning) 16%, transparent) !important;
    }


/*---------------------------------------------------------------------------------------------------------*/
/*Chips*/
/*---------------------------------------------------------------------------------------------------------*/
.master-chip {
    border-radius: 999px;
    font-weight: 600;
    font-size: .72rem;
}


.master-actions .mud-button {
    min-width: 120px;
    border-radius: 10px;
    text-transform: none;
    font-weight: 600;
}

.chip-count {
    opacity: .65;
    font-weight: 400;
    margin-left: 3px;
}


/* Base style to match currency chip dimensions */
.status-chip {
    border-radius: 999px;
    font-weight: 600;
    font-size: .72rem;
}

    /* Active State (Soft Green) */
    .status-chip.active {
        background-color: rgba(34, 197, 94, 0.15) !important; /* Soft Tailwind Green tint */
        color: #16a34a !important;
    }

    /* Inactive State (Soft Gray) */
    .status-chip.inactive {
        background-color: rgba(239, 68, 68, 0.15) !important; /* Soft Tailwind Gray tint */
        color: #dc2626 !important;
    }
