.icon-button, .avatar-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.sidebar-brand-actions .sidebar-close { display: none; }
@media (max-width: 900px) { .sidebar-brand-actions .sidebar-close { display: inline-flex; } }
.avatar-button span, .avatar { display: grid; place-items: center; border-radius: 999px; background: var(--gray-900); color: var(--gray-0); font-weight: 800; }
.avatar-button span { width: 30px; height: 30px; font-size: 12px; }
.avatar-large { width: 64px; height: 64px; }
.status-dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border: 2px solid var(--surface); border-radius: 999px; background: var(--orange); }
.status-dot-green { background: var(--green); }
.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 0 14px; font-weight: 700; color: var(--text); background: var(--surface); white-space: nowrap; transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary-default); color: #fff; border-color: var(--primary-default); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-default) 18%, transparent); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-primary:focus-visible { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-default) 24%, transparent), 0 8px 18px color-mix(in srgb, var(--primary-default) 18%, transparent); }
.btn-outline { border-color: var(--border); }
.btn-ghost { color: var(--blue); background: transparent; }
.btn-small { min-height: 34px; font-size: 13px; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); outline: 0; transition: background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.input, .select { height: 42px; padding: 0 12px; }
.select { -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 40px; background-color: var(--surface-muted); background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5' stroke='%23666666' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px 18px; color: var(--gray-600); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-300); background-color: var(--surface); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-default); background-color: var(--surface); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-default) 18%, transparent); }
.select:disabled { cursor: not-allowed; opacity: .58; }
.soft-select-native { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.soft-select { position: relative; width: 100%; min-width: 0; color: var(--text); }
.soft-select-trigger { position: relative; width: 100%; min-height: 42px; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); color: var(--gray-600); padding: 0 40px 0 12px; font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease; }
.soft-select-trigger::after { content: ""; position: absolute; right: 15px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--gray-400); border-bottom: 2px solid var(--gray-400); transform: translateY(-62%) rotate(45deg); transition: transform .16s ease, border-color .16s ease; }
.soft-select-trigger:hover { border-color: var(--gray-300); background: var(--surface); color: var(--text); }
.soft-select-trigger:focus-visible, .soft-select.is-open .soft-select-trigger { outline: 0; border-color: var(--primary-default); background: var(--surface); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-default) 18%, transparent); }
.soft-select.is-open .soft-select-trigger::after { border-color: var(--primary-default); transform: translateY(-28%) rotate(225deg); }
.soft-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soft-select.has-placeholder .soft-select-value { color: var(--gray-400); }
.soft-select-menu { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 2300; display: none; max-height: 238px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 16px 42px rgba(17,17,17,.16); padding: 6px; }
.soft-select.is-open .soft-select-menu { display: grid; gap: 2px; }
.soft-select-option { min-height: 38px; width: 100%; display: flex; align-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--gray-600); padding: 0 12px; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.soft-select-option:hover, .soft-select-option:focus-visible { outline: 0; background: var(--surface-muted); color: var(--text); }
.soft-select-option.is-selected, .soft-select-option[aria-selected="true"] { background: var(--blue-soft); color: var(--primary-default); font-weight: 800; }
.soft-select-option:disabled { cursor: not-allowed; opacity: .45; }
.rows-per-page .soft-select { width: 64px; }
.rows-per-page .soft-select-trigger { min-height: 36px; padding: 0 30px 0 10px; }
.rows-per-page .soft-select-trigger::after { right: 11px; width: 7px; height: 7px; }
.textarea { padding: 12px; resize: vertical; }
.field { display: grid; gap: 7px; color: var(--text); font-weight: 700; }
.field span { font-size: 13px; }
.field-wide { grid-column: 1 / -1; }
.widget-card, .metric-card, .welcome-card, .utility-panel, .result-card, .product-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.widget-card { padding: 22px; min-width: 0; }
.widget-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.widget-card__header p { color: var(--text-muted); margin-top: 4px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.metric-card { padding: 20px; display: grid; gap: 12px; }
.metric-card-top { display: flex; justify-content: space-between; gap: 14px; }
.metric-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--blue-soft); position: relative; }
.metric-icon::after { content: ""; position: absolute; inset: 13px; border-radius: 999px; background: currentColor; }
.tone-blue { color: var(--blue); background: var(--blue-soft) !important; }
.tone-green { color: var(--green); background: var(--green-soft) !important; }
.tone-purple { color: var(--purple); background: var(--purple-soft) !important; }
.tone-orange { color: var(--orange); background: var(--orange-soft) !important; }
.metric-card p { color: var(--text-muted); }
.metric-card strong { font-size: 25px; }
.metric-footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--border); padding-top: 12px; color: var(--gray-400); }
.trend-up { color: var(--green); font-weight: 800; }
.trend-down { color: var(--red); font-weight: 800; }
.mini-chart { width: 78px; height: 44px; display: inline-flex; align-items: end; gap: 4px; }
.mini-chart::before { content: ""; width: 100%; height: 100%; background: linear-gradient(to top, var(--blue-soft), transparent); border-radius: 10px; }
.chart-card canvas { width: 100%; min-width: 680px; }
.chart-card, .table-card { overflow: hidden; contain: layout paint; }
.chart-scroll, .table-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; padding-bottom: 2px; contain: layout paint; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 999px; }
.legend-blue { background: var(--blue); }
.legend-green { background: var(--green); }
.legend-purple { background: var(--purple); }
.toolbar-search { min-height: 40px; min-width: 230px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; background: var(--surface-muted); }
.toolbar-search input { border: 0; outline: 0; background: transparent; color: var(--text); min-width: 0; }
.data-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; color: var(--text-muted); }
.data-table th { background: var(--surface-muted); color: var(--text); font-size: 12px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: 15px 14px; }
.data-table th:first-child { border-top-left-radius: 10px; }
.data-table th:last-child { border-top-right-radius: 10px; }
.check-row { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.badge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 800; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-warning { background: var(--orange-soft); color: #9a5d00; }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: var(--text-muted); }
.smart-table { table-layout: fixed; border-collapse: separate; }
.smart-table th, .smart-table td { position: relative; }
.smart-table th { user-select: none; white-space: nowrap; }
.smart-table td { background: var(--surface); }
.smart-table tbody tr[hidden], .smart-table tbody tr[hidden] + tr[data-detail-for] { display: none; }
.smart-table tbody tr.is-expanded > td { border-bottom-color: transparent; }
.smart-table tbody tr.is-row-dragging > td { background: color-mix(in srgb, var(--primary-default) 7%, var(--surface)); opacity: .72; }
.smart-table tbody tr.is-row-drop-target > td { box-shadow: inset 0 2px 0 var(--primary-default); }
.smart-table [data-sortable] { cursor: pointer; }
.smart-table [data-sortable]::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: 7px; vertical-align: 2px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .34; }
.smart-table [data-sortable][aria-sort="ascending"]::after { border-top: 0; border-bottom: 5px solid var(--primary-default); opacity: .9; }
.smart-table [data-sortable][aria-sort="descending"]::after { border-top-color: var(--primary-default); opacity: .9; }
.table-expand-toggle, .table-drag-handle, .column-drag-handle, .table-layout-reset { width: 30px; height: 30px; border-color: transparent; border-radius: 8px; background: transparent; color: var(--gray-500); }
.table-expand-toggle:hover, .table-drag-handle:hover, .column-drag-handle:hover, .table-layout-reset:hover { border-color: var(--border); background: var(--surface); color: var(--primary-default); }
.table-expand-toggle svg, .table-drag-handle svg, .column-drag-handle svg, .table-layout-reset svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.table-expand-toggle svg { transition: transform .18s ease; }
tr.is-expanded .table-expand-toggle svg { transform: rotate(90deg); }
.table-drag-handle, .column-drag-handle { cursor: grab; }
.table-drag-handle:active, .column-drag-handle:active { cursor: grabbing; }
.column-drag-handle { position: absolute; left: 4px; top: 50%; translate: 0 -50%; opacity: 0; }
.smart-table th:hover .column-drag-handle, .column-drag-handle:focus-visible, .smart-table th.is-dragging .column-drag-handle { opacity: 1; }
.smart-table th:has(.column-drag-handle) { padding-left: 34px; }
.smart-table th.is-drop-target { box-shadow: inset 3px 0 0 var(--primary-default); }
.table-resize-handle { position: absolute; top: 9px; right: -1px; bottom: 9px; z-index: 2; width: 10px; cursor: col-resize; touch-action: none; }
.table-resize-handle::after { content: ""; position: absolute; top: 0; right: 4px; width: 2px; height: 100%; border-radius: 99px; background: transparent; }
.table-resize-handle:hover::after, .smart-table th.is-resizing .table-resize-handle::after { background: var(--primary-default); }
.is-table-resizing, .is-table-resizing * { cursor: col-resize !important; user-select: none !important; }
.smart-table-detail-row > td { padding: 0 !important; background: color-mix(in srgb, var(--primary-default) 3%, var(--surface)); }
.smart-table-detail-panel { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin: 0; border-top: 1px solid color-mix(in srgb, var(--primary-default) 14%, var(--border)); padding: 18px 22px; }
.smart-table-detail-panel > div { display: grid; gap: 5px; min-width: 0; }
.smart-table-detail-panel span { color: var(--gray-500); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.smart-table-detail-panel strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 14px; }
.smart-table-detail-panel p { margin: 0; color: var(--gray-600); line-height: 1.5; }
.smart-table-demo .widget-card__header { align-items: center; }
.smart-table-demo .table-scroll { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0; }
.smart-table-demo .data-table { min-width: 1080px; }
.smart-table-demo .table-footer { padding-inline: 2px; }
.pagination { display: inline-flex; gap: 4px; }
.pagination button { min-width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.pagination .is-active { background: var(--primary-default); border-color: var(--primary-default); color: #fff; }
.progress-list { display: grid; gap: 18px; }
.progress-row { display: grid; gap: 8px; }
.progress-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.progress-row span { color: var(--text-muted); }
.progress-track { height: 8px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; }
.timeline { list-style: none; display: grid; gap: 16px; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 54px 1fr; gap: 14px; }
.timeline time { color: var(--blue); font-weight: 800; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); right: auto; z-index: 1100; min-width: 210px; display: none; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-menu); padding: 8px; }
.dropdown-menu-right { right: 0; }
.dropdown.is-open .dropdown-menu { display: grid; }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; border: 0; border-radius: 8px; background: transparent; color: var(--text); padding: 10px; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-muted); }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 2500; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 360px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-menu); color: var(--text); padding: 12px 14px; }
.modal { position: fixed; inset: 0; z-index: 2200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .58); }
.modal-panel { position: relative; z-index: 1; width: min(100%, 620px); max-height: min(86vh, 920px); overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 70px rgba(17, 17, 17, .22); color: var(--text); padding: 24px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.modal-header h2 { font-size: 22px; }
.modal-close { width: 34px; height: 34px; border-color: transparent; background: transparent; }
.modal-actions { display: flex; justify-content: flex-end; gap: 14px; margin-top: 24px; }
.modal-actions .btn { min-width: 112px; }
body.modal-open { overflow: hidden; }
@media (max-width: 767px) { .widget-card { padding: 18px; } .widget-card__header, .table-footer { display: grid; } .toolbar { flex-wrap: wrap; } .toolbar-search { min-width: 100%; } }
@media (max-width: 1180px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .metric-grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  .data-table { min-width: 100%; table-layout: auto; }
  .data-table th, .data-table td { overflow-wrap: anywhere; }
  .smart-table { table-layout: fixed; }
  .smart-table-detail-panel { grid-template-columns: 1fr; }
  .chart-card canvas { min-width: 560px; }
}
@media (max-width: 430px) {
  .data-table { min-width: 100%; }
  .chart-card canvas { min-width: 480px; }
  .modal { align-items: stretch; padding: 12px; }
  .modal-panel { max-height: calc(100vh - 24px); padding: 20px; }
  .modal-actions { display: grid; grid-template-columns: 1fr; }
}
