/* =========================================================
   CSMS — Creative IT kleurschema + layout overrides
   ========================================================= */

:root {
    --cit-rood: #3CAA3C;
    --cit-rood-donker: #2E8B2E;
    --cit-donker: #37474F;
    --cit-grijs: #F5F7FA;
    --cit-licht: #F0F8F0;
    --cit-grijs-text: #6c757d;
    --cit-border: #E0E0E0;
    --cit-groen: #3CAA3C;
    --cit-blauw: #1565C0;
    --cit-blauw-licht: #E3F2FD;
    --cit-geel: #FFC107;
    --cit-sidebar-breedte: 240px;
    --cit-header: #1565C0;
}

/* Sidebar */
.mud-drawer {
    background-color: #FFFFFF !important;
    color: var(--cit-donker) !important;
    border-right: 1px solid var(--cit-border) !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.06) !important;
}

.mud-nav-link {
    color: var(--cit-donker) !important;
    border-radius: 6px;
    margin: 2px 8px;
    font-weight: 500;
    font-size: .875rem;
    transition: background-color 0.15s;
}

.mud-nav-link:hover {
    background-color: var(--cit-blauw-licht) !important;
    color: var(--cit-blauw) !important;
}

.mud-nav-link.active {
    background-color: var(--cit-rood) !important;
    color: #FFFFFF !important;
}

.mud-nav-link .mud-icon-root {
    color: var(--cit-blauw) !important;
}

.mud-nav-link.active .mud-icon-root,
.mud-nav-link:hover .mud-icon-root {
    color: #FFFFFF !important;
}

/* Appbar */
.mud-appbar {
    background-color: var(--cit-header) !important;
}

/* Kassa layout */
.kassa-container {
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 16px;
    height: calc(100vh - 80px);
}

.kassa-items-panel {
    overflow-y: auto;
}

.kassa-bon-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.kassa-bon-regels {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.kassa-bon-footer {
    border-top: 2px solid var(--cit-grijs);
    padding: 12px;
}

.item-card {
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60,170,60,0.2);
}

.item-card:active {
    transform: translateY(0);
}

/* Badges voorraad */
.voorraad-laag {
    color: #dc3545;
    font-weight: 600;
}

.voorraad-ok {
    color: #28a745;
}

/* Totaal regel */
.bon-totaal {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cit-rood);
}

/* Stat cards dashboard */
.stat-card .mud-card-header {
    background: var(--cit-rood);
    color: white;
}

.stat-bedrag {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cit-donker);
}

/* Tabel acties */
.tabel-acties {
    white-space: nowrap;
}

/* Logo */
.sidebar-logo {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-logo img {
    height: 32px;
}

/* Kassa ID badge */
.kassa-badge {
    background: var(--cit-rood);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* =========================================================
   Badge kleur varianten
   ========================================================= */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .7rem;
    font-weight: 700;
}
.badge-green  { background: #d4edda; color: #155724; }
.badge-red    { background: #f8d7da; color: #721c24; }
.badge-yellow { background: #fff3cd; color: #856404; }
.badge-blue   { background: #cfe2ff; color: #084298; }

/* =========================================================
   Card titel met rode onderlijn (voor eigen cards naast MudBlazor)
   ========================================================= */
.card-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--cit-donker);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cit-rood);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================================
   Tabel overrides
   ========================================================= */
.csms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}
.csms-table th {
    background: var(--cit-blauw-licht);
    color: var(--cit-blauw);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
}
.csms-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.csms-table tr:hover td {
    background: #fafafa;
}

/* MudBlazor DataGrid header licht */
.mud-table-head .mud-table-cell {
    background: var(--cit-blauw-licht) !important;
    color: var(--cit-blauw) !important;
    font-weight: 600;
}

/* =========================================================
   Form focus — rode rand
   ========================================================= */
.mud-input.mud-input-underline:after {
    border-bottom-color: var(--cit-rood) !important;
}
.mud-input-label.mud-input-label-inputcontrol.mud-input-label-animated.mud-focused {
    color: var(--cit-rood) !important;
}
.mud-checkbox .mud-checkbox-icons .mud-icon-button-label .mud-icon-root.mud-svg-icon {
    color: var(--cit-rood);
}

/* =========================================================
   Grid hulpklassen
   ========================================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* =========================================================
   Bon header (bon#, klok)
   ========================================================= */
.bon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--cit-donker);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    flex-shrink: 0;
}

/* =========================================================
   Bon regels stijl
   ========================================================= */
.bon-line {
    display: flex;
    flex-direction: column;
    padding: 6px 4px;
    border-bottom: 1px solid #f0f0f0;
    font-size: .82rem;
}
.bon-line__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bon-line__naam {
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bon-line__bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.bon-line__kor {
    color: #999;
    font-size: .7rem;
}
.bon-line__bedrag {
    margin-left: auto;
    font-weight: 700;
    font-size: .9rem;
    white-space: nowrap;
}
.bon-line__btw {
    font-size: .72rem;
    color: var(--cit-grijs-text);
    padding-left: 2px;
    margin-top: 1px;
}
.qty-ctrl {
    display: flex;
    align-items: center;
    gap: 3px;
}
.qty-ctrl button {
    width: 22px;
    height: 22px;
    border: 1px solid var(--cit-border);
    background: #f8f8f8;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: .75rem;
}
.qty-ctrl span {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
}
.bonkorting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    font-size: .85rem;
    font-weight: 600;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 5px;
    margin: 4px 0;
}
.bonkorting-row input[type=text] {
    width: 90px;
    border: 1px solid #ffb300;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: .85rem;
    text-align: right;
    background: #fff;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: .8rem;
}
.total-grand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--cit-rood);
    border-top: 2px solid var(--cit-border);
    margin-top: 6px;
    padding-top: 6px;
    display: flex;
    justify-content: space-between;
}

/* =========================================================
   Item kaart inhoud
   ========================================================= */
.item-card .ic-code  { font-size: .78rem; font-weight: 700; color: var(--cit-donker); margin-bottom: 3px; letter-spacing: .3px; }
.item-card .ic-name  { font-weight: 600; margin-bottom: 4px; line-height: 1.2; }
.item-card .ic-price { color: var(--cit-rood); font-weight: 700; font-size: .85rem; }
.item-card .ic-stock { font-size: .68rem; color: var(--cit-groen); }

/* =========================================================
   Tabs
   ========================================================= */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--cit-border);
    margin-bottom: 14px;
    gap: 0;
}
.tab {
    padding: 8px 16px;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--cit-grijs-text);
    transition: .15s;
}
.tab.active, .tab:hover {
    color: var(--cit-rood);
    border-bottom-color: var(--cit-rood);
}

/* =========================================================
   Sectie koppen
   ========================================================= */
.section-heading {
    font-size: .85rem;
    font-weight: 700;
    color: var(--cit-donker);
    margin-bottom: 10px;
    padding: 6px 10px;
    background: var(--cit-licht);
    border-radius: 4px;
    border-left: 3px solid var(--cit-rood);
}

/* =========================================================
   Info / waarschuwing boxen
   ========================================================= */
.info-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: .78rem;
    margin-bottom: 10px;
}
.info-box--yellow { background: #fff3cd; border-color: #ffc107; }
.info-box--blue   { background: #cce5ff; border-color: #004085; }
.info-box__label  { font-size: .72rem; color: #555; margin-bottom: 2px; }
.info-box__value  { font-size: 1.4rem; font-weight: 700; }

.danger-box {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: .78rem;
    margin-bottom: 10px;
}
.success-box {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: .78rem;
    margin-bottom: 10px;
}

/* =========================================================
   Rol pillen
   ========================================================= */
.pill-role  { padding: 2px 10px; border-radius: 10px; font-size: .7rem; font-weight: 700; color: #fff; background: var(--cit-donker); }
.pill-admin { background: var(--cit-rood); }
.pill-kassa { background: var(--cit-blauw); }
.pill-bo    { background: var(--cit-groen); }

/* =========================================================
   Hulp utilities
   ========================================================= */
.text-red    { color: var(--cit-rood); }
.text-green  { color: var(--cit-groen); }
.text-muted  { color: var(--cit-grijs-text); font-size: .78rem; }
.text-center { text-align: center; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.inline-flex { display: inline-flex; align-items: center; gap: 6px; }

/* =========================================================
   KPI Dashboard Kaarten — gradient stijlen
   ========================================================= */
.kpi-card {
    border-radius: 16px;
    color: white;
    padding: 20px 22px 16px 22px;
    min-height: 115px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.kpi-card .kpi-trend {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 2px;
}
.kpi-card .kpi-label {
    font-size: 0.78rem;
    font-weight: 500;
    opacity: 0.88;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpi-card .kpi-waarde {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
}
.kpi-card .kpi-sub {
    font-size: 0.7rem;
    opacity: 0.75;
}
.kpi-card .kpi-icon-bg {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.12;
    pointer-events: none;
}

/* Gradient kleurthema's — gematcht op screenshot */
.kpi-groen  { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.kpi-blauw  { background: linear-gradient(135deg, #4776e6 0%, #8e54e9 100%); }
.kpi-paars  { background: linear-gradient(135deg, #7b2ff7 0%, #f107a3 100%); }
.kpi-oranje { background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%); }
.kpi-amber  { background: linear-gradient(135deg, #f09819 0%, #edde5d 100%); }
.kpi-teal   { background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%); }
.kpi-rood   { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }

/* =========================================================
   StatKaart — witte widget met gekleurde icoondoos
   ========================================================= */
.stat-kaart {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 22px;
    min-height: 110px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-kaart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.stat-kaart-icoon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.stat-kaart-icoon .mud-icon-root { font-size: 1.5rem; }
.stat-kaart-body { flex: 1; min-width: 0; }
.stat-kaart-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #90a4ae;
    margin-bottom: 6px;
}
.stat-kaart-waarde {
    font-size: 1.75rem;
    font-weight: 700;
    color: #263238;
    line-height: 1.1;
    margin-bottom: 4px;
}
.stat-kaart-sub {
    font-size: 0.72rem;
    color: #90a4ae;
}

/* Icoondoos kleuren */
.stat-icoon-amber  { background: linear-gradient(135deg, #f09819, #edde5d); }
.stat-icoon-blauw  { background: linear-gradient(135deg, #4776e6, #8e54e9); }
.stat-icoon-teal   { background: linear-gradient(135deg, #36d1dc, #5b86e5); }
.stat-icoon-rood   { background: linear-gradient(135deg, #ff416c, #ff4b2b); }
.stat-icoon-groen  { background: linear-gradient(135deg, #11998e, #38ef7d); }

/* Dashboard widget kaarten */
.dash-widget {
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px;
    height: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.dash-widget-titel {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cit-donker);
    margin-bottom: 4px;
}
.dash-widget-sub {
    font-size: 0.75rem;
    color: var(--cit-grijs-text);
    margin-bottom: 16px;
}

.snelactie-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.snelactie-tile:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
