/*
 * Telephasic ERP - Material Dashboard 2 theme adapter
 * Source design system: themes/material-dash-v2 (Bootstrap 5)
 * This adapter preserves the ERP's PHP/JS component contracts.
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --md-primary: #e91e63;
    --md-primary-dark: #d81b60;
    --md-info: #1a73e8;
    --md-success: #4caf50;
    --md-warning: #fb8c00;
    --md-danger: #f44335;
    --md-dark: #344767;
    --md-muted: #7b809a;
    --md-bg: #f0f2f5;
    --md-surface: #fff;
    --md-border: #e9ecef;
    --md-sidebar-start: #42424a;
    --md-sidebar-end: #191919;
    --md-button-start: #42424a;
    --md-button-end: #191919;
    --md-radius: .5rem;
    --md-radius-lg: .75rem;
    --md-shadow: 0 4px 6px -1px rgba(0, 0, 0, .10), 0 2px 4px -1px rgba(0, 0, 0, .06);
    --md-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .10), 0 4px 6px -2px rgba(0, 0, 0, .05);
    --md-sidebar-width: 250px;
    --primary: var(--md-primary);
    --primary-dark: var(--md-primary-dark);
    --secondary: var(--md-dark);
    --bg: var(--md-bg);
    --card-shadow: var(--md-shadow);
    --pa-primary: var(--md-primary);
    --pa-primary-dark: var(--md-primary-dark);
    --pa-primary-bg: #fce4ec;
    --pa-bg: var(--md-bg);
    --pa-card: var(--md-surface);
    --pa-text: var(--md-dark);
    --pa-text-muted: var(--md-muted);
    --pa-border: var(--md-border);
}

html { font-size: 16px; }

body.theme-material-dashboard {
    min-height: 100vh;
    color: var(--md-dark);
    background: var(--md-bg);
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    font-size: .875rem;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -.01em;
}

body.theme-material-dashboard button,
body.theme-material-dashboard input,
body.theme-material-dashboard select,
body.theme-material-dashboard textarea,
body.theme-material-dashboard .apexcharts-text,
body.theme-material-dashboard .apexcharts-legend-text {
    font-family: 'Roboto', system-ui, -apple-system, sans-serif !important;
}

body.theme-material-dashboard ::selection { background: rgba(233, 30, 99, .18); }
body.theme-material-dashboard ::-webkit-scrollbar-track { background: #e9ecef; }
body.theme-material-dashboard ::-webkit-scrollbar-thumb { background: #aeb4c6; }
body.theme-material-dashboard ::-webkit-scrollbar-thumb:hover { background: var(--md-primary); }

body.theme-material-dashboard h1,
body.theme-material-dashboard h2,
body.theme-material-dashboard h3,
body.theme-material-dashboard h4,
body.theme-material-dashboard h5,
body.theme-material-dashboard h6 {
    color: var(--md-dark);
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    letter-spacing: -.02em;
}

/* Application shell */
body.theme-material-dashboard .sidebar {
    position: fixed;
    inset: 16px auto 16px 16px;
    width: var(--md-sidebar-width);
    height: calc(100vh - 32px);
    min-height: 0;
    padding: 0 10px 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(195deg, var(--md-sidebar-start), var(--md-sidebar-end));
    border: 0;
    border-radius: var(--md-radius-lg);
    box-shadow: 0 20px 27px 0 rgba(0, 0, 0, .15);
}

body.theme-material-dashboard .sidebar .brand {
    min-height: 72px;
    height: 72px;
    padding: 0 12px;
    gap: 11px;
    border-bottom: 1px solid rgba(255,255,255,.18);
}

body.theme-material-dashboard .sidebar .brand .logo {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    background: transparent;
    border-radius: 10px;
    box-shadow: none;
}

body.theme-material-dashboard .sidebar .brand span {
    color: #fff;
    font-size: .96rem;
    font-weight: 700;
}

body.theme-material-dashboard .sidebar .brand small { color: rgba(255,255,255,.58); }
body.theme-material-dashboard .sidebar nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 0 3px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: rgba(255,255,255,.2) transparent;
    scrollbar-width: thin;
}

body.theme-material-dashboard .sidebar .nav-group-toggle {
    width: 100%;
    margin: 6px 0 4px;
    padding: 9px 12px 5px;
    color: rgba(255,255,255,.58) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: .6875rem !important;
    font-weight: 700 !important;
    letter-spacing: .055em;
    text-transform: uppercase;
}

body.theme-material-dashboard .sidebar .nav-group-toggle:hover { color: #fff !important; }
body.theme-material-dashboard .sidebar .nav-group-toggle i { font-size: .65rem; }

body.theme-material-dashboard .sidebar .nav-link {
    min-height: 44px;
    margin: 2px 0;
    padding: 10px 12px;
    gap: 12px;
    color: rgba(255,255,255,.78) !important;
    border: 0 !important;
    border-radius: .5rem;
    background: transparent !important;
    box-shadow: none !important;
    transition: background .2s ease, color .2s ease, transform .2s ease;
    font-size: .875rem !important;
    font-weight: 500 !important;
}

body.theme-material-dashboard .sidebar .nav-link i {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex: 0 0 24px;
    color: #fff !important;
    font-size: .93rem;
}

body.theme-material-dashboard .sidebar .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,.10) !important;
    transform: translateX(2px);
}

body.theme-material-dashboard .sidebar .nav-link.active {
    color: #fff !important;
    background: linear-gradient(195deg, #616161, #424242) !important;
    box-shadow: 0 4px 7px -1px rgba(0,0,0,.24), 0 2px 5px rgba(0,0,0,.16) !important;
    font-weight: 600 !important;
}

body.theme-material-dashboard .sidebar .branch-select {
    margin: 12px 0 4px !important;
    color: #fff;
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: .65rem !important;
}

body.theme-material-dashboard .sidebar .user-info {
    position: static;
    width: 100%;
    flex: 0 0 auto;
    min-height: 48px;
    margin: 5px 0 0;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: #fff;
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: .75rem;
    backdrop-filter: blur(8px);
    cursor: pointer;
    text-align: left;
    transition: background .2s ease, border-color .2s ease;
}

body.theme-material-dashboard .sidebar .user-info .avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    font-size: .67rem;
    font-weight: 800;
}

body.theme-material-dashboard .sidebar .user-info .name,
body.theme-material-dashboard .sidebar .user-info .role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.theme-material-dashboard .sidebar .user-info .name { font-size: .7rem; font-weight: 700; }
body.theme-material-dashboard .sidebar .user-info .role { margin-top: 1px; color: rgba(255,255,255,.65); font-size: .61rem; }

body.theme-material-dashboard .sidebar .user-info:hover,
body.theme-material-dashboard .sidebar .user-info:focus-visible {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
    outline: none;
}

body.theme-material-dashboard .main-content {
    min-height: 100vh;
    margin-left: 282px;
    padding: 22px 24px 38px 0;
    background: transparent;
}

body.theme-material-dashboard .main-content > section { max-width: 100%; }

body.theme-material-dashboard .desktop-profile-trigger {
    display: none !important;
}

body.theme-material-dashboard .profile-quick-card {
    top: auto;
    right: auto;
    bottom: 24px;
    left: 282px;
    border: 0;
    border-radius: var(--md-radius-lg);
    box-shadow: 0 20px 27px rgba(0,0,0,.14);
}

/* Headers and surfaces */
body.theme-material-dashboard .page-header {
    min-height: 52px;
    margin: 0 0 18px;
    padding: 8px 12px;
    overflow: visible;
    color: var(--md-dark);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

body.theme-material-dashboard .page-header::before,
body.theme-material-dashboard .page-header::after { display: none !important; }

body.theme-material-dashboard .page-header h1,
body.theme-material-dashboard .page-header h2,
body.theme-material-dashboard .page-header h3,
body.theme-material-dashboard .page-header .page-header-left h2,
body.theme-material-dashboard .page-header .page-header-left h2 { color: var(--md-dark) !important; }

body.theme-material-dashboard .page-header .page-header-left h2 i { color: var(--md-primary) !important; }

body.theme-material-dashboard .page-header .page-header-left h2 {
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

body.theme-material-dashboard .page-header p,
body.theme-material-dashboard .page-header small { color: var(--md-muted) !important; }

body.theme-material-dashboard .glass-card,
body.theme-material-dashboard .dashboard-panel,
body.theme-material-dashboard .stat-card,
body.theme-material-dashboard .card {
    color: var(--md-dark);
    background: var(--md-surface) !important;
    border: 0 !important;
    border-radius: var(--md-radius-lg) !important;
    box-shadow: var(--md-shadow) !important;
    backdrop-filter: none;
}

body.theme-material-dashboard .glass-card { padding: 22px; }
body.theme-material-dashboard .glass-card:hover,
body.theme-material-dashboard .stat-card:hover,
body.theme-material-dashboard .dashboard-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--md-shadow-lg) !important;
}

body.theme-material-dashboard .card-title,
body.theme-material-dashboard .glass-card h4,
body.theme-material-dashboard .glass-card h5,
body.theme-material-dashboard .glass-card h6 { color: var(--md-dark); font-weight: 700; }

body.theme-material-dashboard .card-title i { color: var(--md-primary); }

body.theme-material-dashboard .stat-card {
    min-height: 104px;
    padding: 20px;
    overflow: visible;
}

body.theme-material-dashboard .stat-card::after { display: none; }
body.theme-material-dashboard .stat-label { color: var(--md-muted); font-size: .73rem; font-weight: 600; text-transform: uppercase; }
body.theme-material-dashboard .stat-value { color: var(--md-dark); font-weight: 700; letter-spacing: -.03em; }

body.theme-material-dashboard .dashboard-toolbar,
body.theme-material-dashboard .dashboard-action-strip { gap: 16px; }

body.theme-material-dashboard .dashboard-branch-card,
body.theme-material-dashboard .dashboard-search,
body.theme-material-dashboard .dashboard-refresh-card {
    background: #fff;
    border: 0;
    border-radius: var(--md-radius);
    box-shadow: var(--md-shadow);
}

body.theme-material-dashboard .dashboard-workspace { gap: 22px; }
body.theme-material-dashboard .dashboard-toolbar { margin-bottom: 2px; }
body.theme-material-dashboard .dashboard-hero-grid { gap: 22px; }

body.theme-material-dashboard .dashboard-clock-card {
    background: linear-gradient(195deg, #49a3f1, #1a73e8) !important;
    box-shadow: 0 8px 18px -6px rgba(26, 115, 232, .45) !important;
}

body.theme-material-dashboard .dashboard-action-strip { gap: 22px; }

body.theme-material-dashboard .dashboard-action {
    min-height: 76px;
    border: 0;
    border-radius: var(--md-radius-lg);
    box-shadow: var(--md-shadow);
}

body.theme-material-dashboard .dashboard-action i,
body.theme-material-dashboard .stat-icon,
body.theme-material-dashboard .stat-icon-sm {
    color: #fff;
    background: linear-gradient(195deg, #42424a, #191919);
    box-shadow: 0 5px 10px -5px rgba(0, 0, 0, .45);
}

body.theme-material-dashboard .dashboard-kpi-grid,
body.theme-material-dashboard .dashboard-total-grid {
    row-gap: 22px !important;
}

body.theme-material-dashboard .dashboard-kpi-grid .stat-card,
body.theme-material-dashboard .dashboard-total-grid .stat-card {
    position: relative;
    min-height: 122px;
    margin-top: 1rem;
    padding: 1.25rem 1rem .95rem;
}

body.theme-material-dashboard .dashboard-kpi-grid .stat-card > div:last-child,
body.theme-material-dashboard .dashboard-total-grid .stat-card > div:last-child {
    width: 100%;
    padding-left: 3.75rem;
    text-align: right;
}

body.theme-material-dashboard .dashboard-kpi-grid .stat-icon-sm,
body.theme-material-dashboard .dashboard-total-grid .stat-icon {
    position: absolute;
    top: -1rem;
    left: 1rem;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: .75rem;
    font-size: 1.15rem;
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(0,0,0,.4);
}

body.theme-material-dashboard .dashboard-kpi-grid > div:nth-child(2) .stat-icon-sm {
    background: linear-gradient(195deg, #49a3f1, #1a73e8);
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(26,115,232,.4);
}
body.theme-material-dashboard .dashboard-kpi-grid > div:nth-child(3) .stat-icon-sm,
body.theme-material-dashboard .dashboard-total-grid .income .stat-icon {
    background: linear-gradient(195deg, #66bb6a, #43a047);
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(67,160,71,.4);
}
body.theme-material-dashboard .dashboard-kpi-grid > div:nth-child(4) .stat-icon-sm,
body.theme-material-dashboard .dashboard-total-grid .profit .stat-icon,
body.theme-material-dashboard .dashboard-total-grid .receivables .stat-icon {
    background: linear-gradient(195deg, #ec407a, #d81b60);
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(216,27,96,.4);
}
body.theme-material-dashboard .dashboard-total-grid .expense .stat-icon,
body.theme-material-dashboard .dashboard-total-grid .debt .stat-icon {
    background: linear-gradient(195deg, #ef5350, #e53935);
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(229,57,53,.4);
}

body.theme-material-dashboard .dashboard-kpi-grid .stat-label,
body.theme-material-dashboard .dashboard-total-grid .stat-label {
    margin-bottom: .35rem;
    text-transform: none;
}

body.theme-material-dashboard .dashboard-kpi-grid .stat-value,
body.theme-material-dashboard .dashboard-total-grid .stat-value {
    font-size: 1.35rem;
}

body.theme-material-dashboard .category-chart-box {
    height: 340px;
    max-height: none;
}

body.theme-material-dashboard .dashboard-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 6px 0 28px;
    padding: 0 4px;
}

body.theme-material-dashboard .dashboard-material-chart-grid {
    margin-bottom: 24px;
}

body.theme-material-dashboard .material-chart-card {
    padding: 0 16px 18px;
    overflow: visible;
}

body.theme-material-dashboard .material-chart-card:hover {
    transform: none;
}

body.theme-material-dashboard .material-chart-surface {
    position: relative;
    z-index: 1;
    min-height: 220px;
    margin: -16px 0 0;
    padding: 14px 12px 8px;
    overflow: hidden;
    border-radius: .75rem;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, .14), 0 7px 10px -5px rgba(0, 0, 0, .4);
}

body.theme-material-dashboard .material-chart-blue {
    background: linear-gradient(195deg, #49a3f1, #1a73e8);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, .14), 0 7px 10px -5px rgba(26, 115, 232, .4);
}

body.theme-material-dashboard .material-chart-green {
    background: linear-gradient(195deg, #66bb6a, #43a047);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, .14), 0 7px 10px -5px rgba(67, 160, 71, .4);
}

body.theme-material-dashboard .material-chart-dark {
    background: linear-gradient(195deg, #42424a, #191919);
}

body.theme-material-dashboard .material-chart-surface .chart-box,
body.theme-material-dashboard .material-chart-surface .trend-chart-box {
    height: 205px;
    min-height: 205px;
}

body.theme-material-dashboard .material-chart-copy {
    padding: 26px 6px 0;
}

body.theme-material-dashboard .material-chart-copy h6 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: none;
}

body.theme-material-dashboard .material-chart-copy p,
body.theme-material-dashboard .material-chart-copy small {
    color: var(--md-muted);
    font-size: .78rem;
}

body.theme-material-dashboard .material-chart-copy p { margin: 0; }
body.theme-material-dashboard .material-chart-copy hr { margin: 18px 0 12px; border-color: var(--md-border); opacity: 1; }
body.theme-material-dashboard .material-chart-copy small { display: flex; align-items: center; gap: 6px; }

@media (max-width: 767.98px) {
    body.theme-material-dashboard .dashboard-chart-toolbar { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
    body.theme-material-dashboard .material-chart-surface { margin-top: -10px; }
}

/* Forms and controls */
body.theme-material-dashboard .form-label,
body.theme-material-dashboard .premium-label {
    margin-bottom: .45rem;
    color: var(--md-dark);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
}

body.theme-material-dashboard .form-control,
body.theme-material-dashboard .form-select,
body.theme-material-dashboard .input-group-text {
    min-height: 42px;
    color: var(--md-dark);
    background-color: #fff;
    border: 1px solid #d2d6da;
    border-radius: .5rem;
    box-shadow: none;
}

body.theme-material-dashboard .input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
body.theme-material-dashboard .input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

body.theme-material-dashboard .form-control:focus,
body.theme-material-dashboard .form-select:focus {
    border-color: var(--md-info);
    box-shadow: 0 0 0 2px rgba(26,115,232,.12);
}

body.theme-material-dashboard .form-check-input:checked {
    background-color: var(--md-primary);
    border-color: var(--md-primary);
}

body.theme-material-dashboard .btn,
body.theme-material-dashboard .btn-gradient {
    min-height: 38px;
    padding: .62rem 1.15rem;
    border: 0;
    border-radius: .5rem;
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: none;
    box-shadow: 0 3px 5px -1px rgba(0,0,0,.12);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

body.theme-material-dashboard .btn:hover,
body.theme-material-dashboard .btn-gradient:hover { transform: translateY(-1px); box-shadow: 0 6px 10px -3px rgba(0,0,0,.2); }

body.theme-material-dashboard .btn-primary,
body.theme-material-dashboard .btn-gradient,
body.theme-material-dashboard .premium-save {
    color: #fff !important;
    background: linear-gradient(195deg, var(--md-button-start), var(--md-button-end)) !important;
    border-color: var(--md-button-end) !important;
}

body.theme-material-dashboard .btn-primary:hover,
body.theme-material-dashboard .btn-primary:focus,
body.theme-material-dashboard .btn-gradient:hover,
body.theme-material-dashboard .btn-gradient:focus,
body.theme-material-dashboard .premium-save:hover,
body.theme-material-dashboard .premium-save:focus {
    color: #fff !important;
    background: linear-gradient(195deg, #2f3036, #0f0f10) !important;
    border-color: #0f0f10 !important;
}

body.theme-material-dashboard .btn-info { color: #fff; background: linear-gradient(195deg, #49a3f1, #1a73e8) !important; }
body.theme-material-dashboard .btn-success { color: #fff; background: linear-gradient(195deg, #66bb6a, #43a047) !important; }
body.theme-material-dashboard .btn-warning { color: #fff; background: linear-gradient(195deg, #ffa726, #fb8c00) !important; }
body.theme-material-dashboard .btn-danger { color: #fff; background: linear-gradient(195deg, #ef5350, #e53935) !important; }
body.theme-material-dashboard .btn-secondary { color: #fff; background: linear-gradient(195deg, #747b8a, #495361) !important; }
body.theme-material-dashboard .btn-outline-primary { color: var(--md-button-end) !important; background: transparent !important; border: 1px solid var(--md-button-start) !important; box-shadow: none; }
body.theme-material-dashboard .btn-outline-primary:hover,
body.theme-material-dashboard .btn-outline-primary:focus,
body.theme-material-dashboard .btn-outline-primary.active {
    color: #fff !important;
    background: linear-gradient(195deg, var(--md-button-start), var(--md-button-end)) !important;
    border-color: var(--md-button-end) !important;
}
body.theme-material-dashboard .btn-outline-secondary { color: var(--md-muted); background: transparent !important; border: 1px solid #aeb4c6 !important; box-shadow: none; }

/* Material Dashboard React table system */
body.theme-material-dashboard .material-table-card {
    position: relative;
    margin-top: 2.25rem;
    padding: 0 !important;
    overflow: visible;
}

body.theme-material-dashboard .material-table-card::before {
    content: attr(data-material-title);
    position: relative;
    z-index: 2;
    top: -1.5rem;
    display: flex;
    align-items: center;
    margin: 0 1rem -.5rem;
    min-height: 4.5rem;
    padding: 1rem 1.25rem;
    color: #fff;
    background: linear-gradient(195deg, #49a3f1, #1a73e8);
    border-radius: .75rem;
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(26,115,232,.4);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

body.theme-material-dashboard .material-table-card > .row,
body.theme-material-dashboard .material-table-card > .toolbar,
body.theme-material-dashboard .material-table-card > .d-flex,
body.theme-material-dashboard .material-table-card > .card-title,
body.theme-material-dashboard .material-table-card > :not(.table-responsive) {
    margin-right: 1rem;
    margin-left: 1rem;
}

body.theme-material-dashboard .material-table-card > .d-flex:first-child > .card-title,
body.theme-material-dashboard .material-table-card > .d-flex:first-child > h4,
body.theme-material-dashboard .material-table-card > .d-flex:first-child > div:first-child:has(h4) {
    display: none;
}

body.theme-material-dashboard .material-table-card > .critical-pool-head > .card-title {
    display: none;
}

body.theme-material-dashboard .material-table-card > .d-flex:first-child {
    justify-content: flex-end !important;
}

body.theme-material-dashboard .material-table-card > .critical-pool-head {
    justify-content: flex-end;
}

body.theme-material-dashboard .table-responsive {
    border-radius: 0 0 .75rem .75rem;
    scrollbar-color: #c5c9d4 transparent;
    scrollbar-width: thin;
}

body.theme-material-dashboard .stock-table {
    min-width: 1490px;
    table-layout: fixed;
}

body.theme-material-dashboard .stock-table .stock-col-select { width: 44px; }
body.theme-material-dashboard .stock-table .stock-col-image { width: 72px; }
body.theme-material-dashboard .stock-table .stock-col-product { width: 220px; }
body.theme-material-dashboard .stock-table .stock-col-features { width: 170px; }
body.theme-material-dashboard .stock-table .stock-col-color { width: 120px; }
body.theme-material-dashboard .stock-table .stock-col-category { width: 100px; }
body.theme-material-dashboard .stock-table .stock-col-quantity { width: 80px; }
body.theme-material-dashboard .stock-table .stock-col-purchase,
body.theme-material-dashboard .stock-table .stock-col-sale { width: 140px; }
body.theme-material-dashboard .stock-table .stock-col-value,
body.theme-material-dashboard .stock-table .stock-col-profit { width: 120px; }
body.theme-material-dashboard .stock-table .stock-col-actions { width: 164px; }

body.theme-material-dashboard .stock-table thead th,
body.theme-material-dashboard .stock-table tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
}

body.theme-material-dashboard .stock-table tbody td:last-child {
    overflow: visible;
    white-space: nowrap;
}

body.theme-material-dashboard .stock-table thead th {
    padding: .72rem .65rem .62rem !important;
    font-size: .58rem !important;
}

body.theme-material-dashboard .stock-table tbody td {
    padding: .68rem .65rem !important;
    font-size: .73rem;
}

body.theme-material-dashboard .stock-actions {
    display: flex;
    align-items: center;
    gap: .28rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

body.theme-material-dashboard .stock-actions .btn {
    width: 1.75rem;
    min-width: 1.75rem !important;
    height: 1.75rem;
    min-height: 1.75rem !important;
    display: inline-grid;
    place-items: center;
    flex: 0 0 1.75rem;
    padding: 0 !important;
    border-radius: .4rem;
    font-size: .62rem !important;
}

body.theme-material-dashboard table,
body.theme-material-dashboard .table,
body.theme-material-dashboard .table-custom {
    width: 100%;
    margin-bottom: 0;
    color: var(--md-muted);
    background: #fff;
    border-collapse: separate;
    border-spacing: 0;
}

body.theme-material-dashboard table thead th,
body.theme-material-dashboard .table thead th,
body.theme-material-dashboard .table-custom thead th {
    padding: .95rem 1rem .75rem !important;
    color: #a0a5b5 !important;
    background: #fff !important;
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid #e9ecef !important;
    border-left: 0 !important;
    font-size: .63rem !important;
    font-weight: 700 !important;
    line-height: 1.25;
    letter-spacing: .045em;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

body.theme-material-dashboard table tbody td,
body.theme-material-dashboard .table tbody td,
body.theme-material-dashboard .table-custom tbody td {
    padding: .75rem .8rem !important;
    color: var(--md-muted);
    background-color: #fff;
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid #f0f2f5 !important;
    border-left: 0 !important;
    font-size: .75rem;
    line-height: 1.35;
    vertical-align: middle;
    transition: background-color .18s ease, color .18s ease;
}

body.theme-material-dashboard table tbody tr:last-child > td,
body.theme-material-dashboard .table-custom tbody tr:last-child > td { border-bottom: 0 !important; }

body.theme-material-dashboard table tbody tr:hover > td,
body.theme-material-dashboard .table-hover > tbody > tr:hover > * {
    color: var(--md-dark);
    background-color: rgba(52,71,103,.025) !important;
    box-shadow: none;
}

body.theme-material-dashboard table tbody td strong,
body.theme-material-dashboard table tbody td .fw-bold,
body.theme-material-dashboard table tbody td .fw-semibold,
body.theme-material-dashboard table tbody td:first-child:not(:has(.form-check-input)),
body.theme-material-dashboard .product-cell > div > :first-child {
    color: var(--md-dark);
    font-weight: 600 !important;
}

body.theme-material-dashboard table tbody td small,
body.theme-material-dashboard table tbody td .subtext,
body.theme-material-dashboard table tbody td .text-muted {
    color: #a0a5b5 !important;
    font-size: .7rem !important;
    font-weight: 400;
}

body.theme-material-dashboard .product-cell { gap: .75rem; }
body.theme-material-dashboard .product-thumb,
body.theme-material-dashboard .stock-table tbody td img,
body.theme-material-dashboard table tbody td img:not(.avatar) {
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: .6rem;
    background: #f8f9fa;
    object-fit: contain;
    box-shadow: 0 2px 5px rgba(52,71,103,.12);
}

body.theme-material-dashboard .form-check-input {
    border-color: #c7cad5;
    box-shadow: none;
}

body.theme-material-dashboard .table-custom tbody tr.expense-row > td {
    background: #fff !important;
}

body.theme-material-dashboard .table-custom tbody tr.critical-row > td {
    background: #fff !important;
}

body.theme-material-dashboard .table-custom tbody tr.expense-row > td:first-child { box-shadow: inset 3px 0 #e53935; }
body.theme-material-dashboard .table-custom tbody tr.critical-row > td:first-child { box-shadow: inset 3px 0 #fb8c00; }
body.theme-material-dashboard .table-custom tbody tr.expense-row:hover > td { background: rgba(244,67,54,.035) !important; }
body.theme-material-dashboard .table-custom tbody tr.critical-row:hover > td { background: rgba(251,140,0,.04) !important; }

body.theme-material-dashboard table tbody td:last-child .btn,
body.theme-material-dashboard table tbody td.actions .btn {
    min-width: 1.8rem;
    min-height: 1.8rem;
    padding: .32rem .45rem;
    border-radius: .45rem;
    font-size: .64rem;
    box-shadow: none;
}

body.theme-material-dashboard table tbody td:last-child .btn:hover,
body.theme-material-dashboard table tbody td.actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(52,71,103,.18);
}

body.theme-material-dashboard .badge-soft,
body.theme-material-dashboard table .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .35rem .55rem !important;
    border: 0 !important;
    border-radius: .4rem !important;
    font-size: .58rem !important;
    font-weight: 700 !important;
    line-height: 1;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.theme-material-dashboard .badge-ok,
body.theme-material-dashboard .badge-income,
body.theme-material-dashboard table .bg-success { color: #fff !important; background: linear-gradient(195deg, #66bb6a, #43a047) !important; }
body.theme-material-dashboard .badge-critical,
body.theme-material-dashboard table .bg-warning { color: #fff !important; background: linear-gradient(195deg, #ffa726, #fb8c00) !important; }
body.theme-material-dashboard .badge-empty,
body.theme-material-dashboard .badge-expense,
body.theme-material-dashboard table .bg-danger { color: #fff !important; background: linear-gradient(195deg, #ef5350, #e53935) !important; }
body.theme-material-dashboard table .bg-info { color: #fff !important; background: linear-gradient(195deg, #49a3f1, #1a73e8) !important; }

body.theme-material-dashboard .nav-tabs,
body.theme-material-dashboard .settings-tabs {
    padding: 6px;
    gap: 5px;
    background: #f8f9fa;
    border: 0;
    border-radius: .75rem;
}

body.theme-material-dashboard .nav-tabs .nav-link,
body.theme-material-dashboard .settings-tab {
    color: var(--md-muted);
    border: 0;
    border-radius: .55rem;
    font-weight: 600;
}

body.theme-material-dashboard .nav-tabs .nav-link.active,
body.theme-material-dashboard .settings-tab.active {
    color: var(--md-dark);
    background: #fff;
    box-shadow: var(--md-shadow);
}

body.theme-material-dashboard .dropdown-menu {
    padding: .55rem;
    border: 0;
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(52,71,103,.16);
}

body.theme-material-dashboard .dropdown-item { padding: .62rem .8rem; border-radius: .45rem; color: var(--md-dark); }
body.theme-material-dashboard .dropdown-item:hover,
body.theme-material-dashboard .dropdown-item:focus { color: var(--md-primary); background: #fce4ec; }

body.theme-material-dashboard .modal-content {
    overflow: hidden;
    border: 0 !important;
    border-radius: var(--md-radius-lg) !important;
    box-shadow: 0 20px 45px rgba(52,71,103,.2) !important;
}

body.theme-material-dashboard .modal-header,
body.theme-material-dashboard .premium-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(195deg, #49a3f1, #1a73e8) !important;
    border: 0;
}

body.theme-material-dashboard .modal-header .modal-title,
body.theme-material-dashboard .modal-header .modal-title i,
body.theme-material-dashboard .modal-header .text-muted {
    color: #fff !important;
}

body.theme-material-dashboard .modal-header .btn-close { filter: invert(1) grayscale(1); }
body.theme-material-dashboard .modal-header .btn-close,
body.theme-material-dashboard .modal-header .premium-close {
    margin-left: auto !important;
}

body.theme-material-dashboard .modal-header .btn-outline-primary {
    color: #fff !important;
    background: transparent !important;
    border-color: rgba(255, 255, 255, .75) !important;
}

body.theme-material-dashboard .modal-header .btn-outline-primary:hover,
body.theme-material-dashboard .modal-header .btn-outline-primary:focus {
    color: #1a73e8 !important;
    background: #fff !important;
    border-color: #fff !important;
}

body.theme-material-dashboard .tx-type-option input:checked + span {
    color: #fff !important;
    background: linear-gradient(195deg, var(--md-button-start), var(--md-button-end)) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 7px -1px rgba(25, 25, 25, .34) !important;
}
body.theme-material-dashboard .modal-footer { background: #f8f9fa; border-color: var(--md-border); }

body.theme-material-dashboard .badge { padding: .45em .7em; border-radius: .45rem; font-weight: 600; }
body.theme-material-dashboard .bg-primary { background: var(--md-primary) !important; }
body.theme-material-dashboard .text-primary { color: var(--md-primary) !important; }
body.theme-material-dashboard .alert { border: 0; border-radius: .75rem; }
body.theme-material-dashboard .app-list-pagination { border: 0; border-radius: 0 0 .75rem .75rem; }

body.theme-material-dashboard .loading-overlay {
    background: rgba(240,242,245,.86) !important;
    backdrop-filter: blur(8px);
}

body.theme-material-dashboard .loading-overlay .spinner { border-top-color: var(--md-primary) !important; }

@media (max-width: 991.98px) {
    body.theme-material-dashboard .sidebar {
        inset: 10px auto 10px 10px;
        width: min(280px, calc(100vw - 20px)) !important;
        height: calc(100vh - 20px);
        transform: translateX(calc(-100% - 20px));
    }

    body.theme-material-dashboard .sidebar.mobile-open { transform: translateX(0); }
    body.theme-material-dashboard .main-content { margin-left: 0 !important; padding: 76px 14px 24px !important; }
    body.theme-material-dashboard .mobile-app-bar {
        display: flex;
        color: #fff;
        background: linear-gradient(195deg, var(--md-sidebar-start), var(--md-sidebar-end));
        box-shadow: var(--md-shadow-lg);
    }
    body.theme-material-dashboard .page-header { min-height: 78px; padding: 18px; }
}

@media (max-width: 575.98px) {
    body.theme-material-dashboard .main-content { padding-right: 10px !important; padding-left: 10px !important; }
    body.theme-material-dashboard .main-content .row {
        width: 100%;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    body.theme-material-dashboard .main-content .row > * {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }
    body.theme-material-dashboard .material-table-card {
        margin-top: 1.9rem;
        padding-top: 0 !important;
    }
    body.theme-material-dashboard .material-table-card::before {
        top: -1.2rem;
        margin-right: .65rem;
        margin-bottom: -.35rem;
        margin-left: .65rem;
        min-height: 3.8rem;
        padding: .85rem 1rem;
        font-size: .9rem;
    }
    body.theme-material-dashboard .profile-quick-card {
        top: auto;
        right: 14px;
        bottom: 14px;
        left: 14px;
        width: auto;
    }
    body.theme-material-dashboard table thead th,
    body.theme-material-dashboard .table-custom thead th,
    body.theme-material-dashboard table tbody td,
    body.theme-material-dashboard .table-custom tbody td {
        padding-right: .75rem !important;
        padding-left: .75rem !important;
    }
    body.theme-material-dashboard .page-header { align-items: flex-start; border-radius: .85rem; }
    body.theme-material-dashboard .page-header-right { width: 100%; }
    body.theme-material-dashboard .page-header-right .btn,
    body.theme-material-dashboard .page-header-right .btn-group { flex: 1 1 auto; }
    body.theme-material-dashboard .glass-card { padding: 15px; }
    body.theme-material-dashboard .btn { padding-right: .8rem; padding-left: .8rem; }
}

@media print {
    body.theme-material-dashboard .sidebar,
    body.theme-material-dashboard .mobile-app-bar,
    body.theme-material-dashboard .desktop-profile-trigger { display: none !important; }
    body.theme-material-dashboard .main-content { margin: 0 !important; padding: 0 !important; }
}
