/* KMK UI polish: keep the original KMK palette while improving consistency and usability. */
:root{
    --kmk-ui-blue:var(--primary-700,#1976d2);
    --kmk-ui-blue-dark:var(--primary-800,#1565c0);
    --kmk-ui-text:var(--gray-800,#1e293b);
    --kmk-ui-muted:var(--gray-500,#64748b);
    --kmk-ui-line:var(--gray-200,#e2e8f0);
}
body{color:var(--kmk-ui-text)}

/* Restore the original KMK application colors instead of replacing the brand palette. */
.wrapper .main-content,.app-layout .main-content,.app-layout .content{
    background:linear-gradient(180deg,var(--gray-50,#f8fafc) 0%,#fff 100%)!important;
}
.sidebar,.app-layout .sidebar{
    background:linear-gradient(180deg,var(--primary-900,#0d47a1) 0%,var(--primary-800,#1565c0) 100%)!important;
    box-shadow:var(--shadow-lg)!important;
}
.public-nav{
    background:linear-gradient(135deg,var(--primary-800,#1565c0),var(--primary-900,#0d47a1))!important;
    box-shadow:var(--shadow-md)!important;
}

/* Keep components consistent but avoid excessive template decoration. */
.card,.dashboard-card,.content-card,.table-container{
    border-radius:10px!important;
    box-shadow:var(--shadow-sm)!important;
    border-color:var(--gray-200,#e2e8f0)!important;
}
.card::before,.dashboard-card::before{display:none!important}

.btn,.btn-primary,.btn-secondary,.btn-danger,button.btn{
    border-radius:7px!important;
    box-shadow:none!important;
    transform:none!important;
    transition:background-color .12s ease,border-color .12s ease,color .12s ease!important;
}
.btn-primary,.btn:not(.btn-secondary):not(.btn-danger):not(.btn-outline){
    background-color:var(--primary-700,#1976d2)!important;
    background-image:none!important;
    color:#fff!important;
}
.btn-primary:hover,.btn:not(.btn-secondary):not(.btn-danger):not(.btn-outline):hover{
    background-color:var(--primary-800,#1565c0)!important;
}
.btn-danger{background-color:var(--accent-red,#ef4444)!important;background-image:none!important;border-color:var(--accent-red,#ef4444)!important}
.btn-danger:hover{background-color:#dc2626!important}
.btn-secondary{background:#fff!important;color:var(--gray-700,#334155)!important;border-color:var(--gray-300,#cbd5e1)!important}
.btn-secondary:hover{background:var(--gray-50,#f8fafc)!important}
.btn-outline{background:transparent!important;color:var(--primary-700,#1976d2)!important;border-color:var(--primary-200,#90caf9)!important}
.btn-outline:hover{background:var(--primary-50,#e3f2fd)!important;border-color:var(--primary-400,#42a5f5)!important}

input,select,textarea{border-radius:7px!important;box-shadow:none!important}
input:focus,select:focus,textarea:focus{
    outline:none!important;
    border-color:var(--primary-400,#42a5f5)!important;
    box-shadow:0 0 0 3px var(--primary-100,#bbdefb)!important;
}

.table{border-collapse:collapse}
.table th,.report-table th{
    background:var(--gray-50,#f8fafc)!important;
    background-image:none!important;
    text-transform:none!important;
    letter-spacing:0!important;
    color:var(--gray-600,#475569)!important;
    font-size:.78rem!important;
}
.table td,.table th,.report-table td,.report-table th{border-color:var(--gray-200,#e2e8f0)!important}
.kmk-sortable-th{cursor:pointer;user-select:none;padding-right:1.35rem!important;position:relative}
.kmk-sortable-th::after{content:'↕';position:absolute;right:.45rem;color:var(--gray-400,#94a3b8);font-size:.7rem}
.kmk-sortable-th[aria-sort="ascending"]::after{content:'↑';color:var(--primary-700,#1976d2)}
.kmk-sortable-th[aria-sort="descending"]::after{content:'↓';color:var(--primary-700,#1976d2)}
.kmk-sortable-th:focus-visible{outline:2px solid var(--primary-400,#42a5f5);outline-offset:-2px}

/* Medium, click-through toasts: visible enough to read without blocking controls. */
.toast-container{top:.9rem!important;right:.9rem!important;gap:.5rem!important;max-width:380px!important;pointer-events:none!important}
.toast{
    background:#fff!important;
    color:var(--gray-700,#334155)!important;
    border:1px solid var(--gray-200,#e2e8f0)!important;
    border-left:4px solid var(--gray-500,#64748b)!important;
    border-radius:8px!important;
    box-shadow:0 7px 20px rgba(15,23,42,.16)!important;
    padding:.72rem .9rem!important;
    gap:.6rem!important;
    font-size:.9rem!important;
    line-height:1.4!important;
    min-width:300px!important;
    max-width:380px!important;
    animation:kmkToastIn .16s ease-out!important;
    cursor:default!important;
    pointer-events:none!important;
}
.toast>span:first-child{font-size:1.05rem!important;line-height:1!important}
.toast-close{display:none!important}
.toast::after{display:none!important}
.toast-success{border-left-color:var(--accent-green,#10b981)!important}
.toast-error{border-left-color:var(--accent-red,#ef4444)!important}
.toast-warning{border-left-color:var(--accent-orange,#f59e0b)!important}
.toast-info{border-left-color:var(--primary-700,#1976d2)!important}
.toast-success>span:first-child{color:#059669}.toast-error>span:first-child{color:#dc2626}.toast-warning>span:first-child{color:#d97706}.toast-info>span:first-child{color:var(--primary-700,#1976d2)}
@keyframes kmkToastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}

.kmk-modal-overlay,.modal-overlay{background:rgba(15,23,42,.45)!important;backdrop-filter:none!important}
.kmk-modal-box,.modal-box,.modal{
    border-radius:10px!important;
    box-shadow:var(--shadow-xl)!important;
    text-align:left!important;
    padding:1.25rem!important;
    border:1px solid var(--gray-200,#e2e8f0)!important;
}
.kmk-modal-box h3,.modal-box h3{font-size:1rem!important;color:var(--gray-800,#1e293b)!important}
.kmk-modal-box p,.modal-box p{color:var(--gray-500,#64748b)!important;line-height:1.5!important}
.kmk-modal-actions,.modal-actions{justify-content:flex-end!important}
.pagination .current{background:var(--primary-700,#1976d2)!important;background-image:none!important;box-shadow:none!important}
.status-badge,[class^="status-"]{box-shadow:none!important}

/* Catalog: subtle feedback, not a floating template-style card. */
.product-grid{gap:1rem!important}
.product-card,.kmk-catalog-card{
    border:1px solid var(--gray-200,#e2e8f0)!important;
    border-radius:10px!important;
    box-shadow:var(--shadow-sm)!important;
    background:#fff!important;
    transition:border-color .14s ease,box-shadow .14s ease!important;
    overflow:hidden;
}
.product-card:hover,.kmk-catalog-card:hover{
    transform:translateY(-2px)!important;
    border-color:var(--primary-400,#42a5f5)!important;
    box-shadow:0 7px 18px rgba(21,101,192,.12)!important;
}
.product-card img,.kmk-catalog-card img{transition:opacity .14s ease!important}
.product-card:hover img,.kmk-catalog-card:hover img{transform:none!important;opacity:.97}
.kmk-catalog-body{padding:1rem}
.kmk-catalog-name{margin:0 0 .25rem;font-size:1rem;color:var(--gray-800,#1e293b)}
.kmk-catalog-category{font-size:.76rem;color:var(--gray-500,#64748b);margin:.2rem 0 .5rem}
.kmk-catalog-price{font-size:1rem;font-weight:700;color:var(--primary-700,#1976d2);margin:.25rem 0 .9rem}
.kmk-catalog-image{width:100%;height:180px;object-fit:cover;background:var(--gray-100,#f1f5f9)}
.kmk-catalog-placeholder{width:100%;height:180px;background:var(--gray-100,#f1f5f9);display:flex;align-items:center;justify-content:center;color:var(--gray-400,#94a3b8);font-size:.85rem}
.kmk-model-badge{display:inline-block;background:var(--primary-50,#e3f2fd);color:var(--primary-800,#1565c0);border:1px solid var(--primary-100,#bbdefb);font-size:.68rem;font-weight:600;padding:3px 6px;border-radius:5px;margin-bottom:.4rem}

/* Catalog actions are plain KMK-blue text links, not rectangular buttons. */
.kmk-catalog-actions{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;margin-top:.1rem}
.kmk-catalog-action-link{
    display:inline!important;
    background:none!important;
    background-image:none!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    color:var(--primary-700,#1976d2)!important;
    padding:0!important;
    margin:0!important;
    min-width:0!important;
    min-height:0!important;
    width:auto!important;
    line-height:1.4!important;
    font-size:.83rem!important;
    font-weight:600!important;
    text-decoration:none!important;
}
.kmk-catalog-action-link:hover,.kmk-catalog-action-link:focus-visible{
    background:none!important;
    color:var(--primary-900,#0d47a1)!important;
    text-decoration:underline!important;
}
.product-card .product-info,.kmk-catalog-body{display:flex;flex-direction:column;align-items:flex-start}

.kmk-catalog-filters{display:flex;gap:.75rem;align-items:flex-end;flex-wrap:wrap}
.kmk-filter-actions{display:flex;align-items:flex-end;min-height:36px}
.kmk-filter-clear{display:inline-flex!important;align-items:center!important;justify-content:center!important;height:36px!important;padding:0 .9rem!important;margin:0!important}

@media(prefers-reduced-motion:no-preference){.nav-item,.sidebar a{transition:background-color .12s ease,color .12s ease!important}}
@media(max-width:600px){.toast-container{left:.6rem!important;right:.6rem!important;max-width:none!important}.toast{min-width:0!important;width:100%!important;max-width:none!important}.kmk-sortable-th::after{right:.25rem}}

/* Keep the shell orderly without changing KMK's visual identity. */
.nav-item,.sidebar a{border-radius:var(--radius-sm,8px)!important}
.sidebar-brand{border-bottom-color:rgba(255,255,255,.12)!important}
.page-header{padding-bottom:1rem!important;margin-bottom:1.5rem!important;border-bottom:1px solid var(--gray-200,#e2e8f0)!important}
.page-header h1{font-size:1.55rem!important;letter-spacing:-.01em!important}
.page-header p{font-size:.9rem!important;color:var(--gray-500,#64748b)!important}
.table-header{margin-bottom:1rem!important}.section-header h2{font-size:1.15rem!important;letter-spacing:0!important}
