@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

html,
body {
    margin: 0;
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
    background: #f4f6f8;
    direction: ltr;
    text-align: left;
}

.mud-typography,
.mud-button,
.mud-input,
.mud-table,
.mud-navmenu,
.mud-list,
.mud-select,
.mud-popover,
.mud-alert,
.mud-chip,
.mud-dialog,
.mud-card,
.mud-paper,
.mud-tabs,
.mud-tab,
.mud-table-root,
.mud-table-root *,
.mud-table,
.mud-table *,
.mud-table-cell,
.mud-table-head,
.mud-table-body,
.mud-table-pagination,
.mud-input-control,
.mud-picker,
.mud-menu {
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif !important;
    letter-spacing: 0 !important;
}

pre,
code {
    font-family: Consolas, "Courier New", monospace;
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.mud-table pre,
.mud-table code {
    font-family: Consolas, "Courier New", monospace !important;
}

.kayno-drawer .mud-nav-link.active,
.kayno-drawer .mud-nav-link.active:hover,
.kayno-drawer .mud-nav-link.active .mud-nav-link-text,
.kayno-drawer .mud-nav-link.active .mud-nav-link-icon,
.kayno-drawer .mud-nav-link.active .mud-icon-root {
    color: #f8fafc !important;
}

.kayno-drawer .mud-nav-link.active {
    background: rgba(248, 250, 252, .12) !important;
}

.kayno-drawer .mud-nav-link:hover {
    background: rgba(248, 250, 252, .08) !important;
}

.kayno-ltr {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.kayno-ltr-field input,
.kayno-ltr-field textarea,
.kayno-ltr-field .mud-input-slot {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.kayno-page {
    max-width: 1500px;
    margin: 0 auto;
}

.kayno-panel {
    border: 1px solid #d9e0e5;
}

.kayno-section-panel {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #ffffff;
}

.kayno-section-heading {
    min-height: 42px;
}

.kayno-section-icon {
    color: #ffffff;
    background: #2f5f7a;
}

.kayno-wrap {
    flex-wrap: wrap;
}

.kayno-code {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 360px;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid #d9e0e5;
    border-radius: 6px;
    padding: 12px;
}

.kayno-file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 86px;
    border: 1px dashed #a9bac3;
    border-radius: 8px;
    background: #f8fafc;
    color: #2f5f7a;
    cursor: pointer;
    text-align: center;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.kayno-file-upload:hover {
    border-color: #2f5f7a;
    background: #eef4f7;
}

.kayno-file-upload input[type="file"] {
    display: none;
}

.kayno-file-upload .mud-icon-root {
    font-size: 1.6rem;
}

.kayno-file-upload.disabled {
    cursor: progress;
    opacity: .72;
    pointer-events: none;
}

.kayno-upload-panel {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}

.kayno-upload-status {
    margin-top: 10px;
}

.kayno-upload-actions {
    margin-top: 10px;
    flex-wrap: wrap;
}

.kayno-module-list-panel {
    min-height: 100%;
}

.kayno-module-card,
.kayno-software-card,
.kayno-variable-card,
.kayno-run-summary,
.kayno-selection-card,
.kayno-module-stat,
.kayno-module-hero {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #ffffff;
}

.kayno-module-card {
    min-height: 196px;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.kayno-role-card {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    min-height: 190px;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.kayno-role-card:hover {
    border-color: #8fb1c2;
    box-shadow: 0 10px 24px rgba(20, 39, 51, .08);
    transform: translateY(-1px);
}

.kayno-policy-stat,
.kayno-role-mini-stat {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #f8fafc;
}

.kayno-policy-stat {
    min-height: 94px;
}

.kayno-role-mini-stat {
    padding: 8px 10px;
}

.kayno-role-mini-stat span {
    display: block;
    color: #6b7780;
    font-size: .78rem;
}

.kayno-role-mini-stat strong {
    display: block;
    color: #243642;
    font-size: 1.15rem;
    font-weight: 700;
}

.kayno-role-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kayno-software-card {
    min-height: 210px;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.kayno-module-card:hover,
.kayno-software-card:hover {
    border-color: #b8c7d0;
    box-shadow: 0 8px 22px rgba(30, 41, 51, .08);
    transform: translateY(-1px);
}

.kayno-module-card-icon,
.kayno-module-hero-icon,
.kayno-software-icon {
    color: #ffffff;
    background: #1f4e5f;
}

.kayno-software-icon.approved {
    background: #2e7d5b;
}

.kayno-software-icon.blocked {
    background: #a33a3a;
}

.kayno-module-hero {
    background: #f8fafc;
}

.kayno-module-stat {
    min-height: 104px;
}

.kayno-variable-card,
.kayno-run-summary,
.kayno-selection-card {
    background: #f8fafc;
}

.kayno-selection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 520px;
    overflow: auto;
    padding-left: 2px;
}

.kayno-selection-card {
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.kayno-selection-card:hover {
    border-color: #b8c7d0;
    background: #f4f8fa;
}

.kayno-selection-card.selected {
    border-color: #2f5f7a;
    background: #eef4f7;
    box-shadow: inset -4px 0 0 #2f5f7a;
}

.kayno-selection-card-body {
    min-width: 0;
    flex: 1;
}

.kayno-selection-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 6px 0;
    color: #5b6873;
    font-size: .78rem;
}

.kayno-metric {
    min-height: 104px;
}

.kayno-table-code {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 160px;
    overflow: auto;
    margin: 0;
}

.kayno-line-chart {
    height: 160px;
    border: 1px solid #d9e0e5;
    border-radius: 6px;
    background: #f8fafc;
    overflow: hidden;
}

.kayno-line-chart svg {
    display: block;
    width: 100%;
    height: 100%;
}

.kayno-chart-grid {
    stroke: #d9e0e5;
    stroke-width: .35;
}

.kayno-chart-line {
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kayno-chart-line-cpu {
    stroke: #2f5f7a;
}

.kayno-chart-line-ram {
    stroke: #2e7d5b;
}

.kayno-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.kayno-detail-grid div {
    min-height: 72px;
    border: 1px solid #d9e0e5;
    border-radius: 6px;
    background: #f8fafc;
    padding: 12px;
}

.kayno-detail-grid span {
    display: block;
    color: #5b6873;
    font-size: .78rem;
    margin-bottom: 6px;
}

.kayno-detail-grid strong {
    display: block;
    color: #1e2933;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.kayno-subpanel {
    border: 1px solid #d9e0e5;
    background: #f8fafc;
}

.kayno-stacked-bar {
    display: flex;
    flex-direction: row;
    height: 18px;
    width: 100%;
    overflow: hidden;
    background: #eef2f5;
    border: 1px solid #d9e0e5;
    border-radius: 6px;
}

.kayno-stacked-bar.compact {
    height: 12px;
    flex: 1;
    min-width: 160px;
}

.kayno-bar-success {
    background: #2e7d5b;
}

.kayno-bar-info {
    background: #2f5f7a;
}

.kayno-bar-danger {
    background: #a33a3a;
}

.kayno-bar-muted {
    background: #a9bac3;
}

.kayno-bar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    color: #5b6873;
    font-size: .82rem;
}

.kayno-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-left: 6px;
}

.kayno-dot.success {
    background: #2e7d5b;
}

.kayno-dot.info {
    background: #2f5f7a;
}

.kayno-dot.danger {
    background: #a33a3a;
}

.kayno-dot.muted {
    background: #a9bac3;
}

.kayno-dashboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 32px;
}

.kayno-dashboard-row span {
    width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kayno-dashboard-header,
.kayno-dashboard-kpi,
.kayno-dashboard-chart-panel,
.kayno-dashboard-table-panel {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #ffffff;
}

.kayno-dashboard-header {
    background: #f8fafc;
}

.kayno-dashboard-kpi {
    min-height: 142px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kayno-dashboard-kpi-icon {
    color: #ffffff;
}

.kayno-dashboard-kpi-icon.success {
    background: #2e7d5b;
}

.kayno-dashboard-kpi-icon.info {
    background: #2f5f7a;
}

.kayno-dashboard-kpi-icon.neutral {
    background: #52616b;
}

.kayno-dashboard-kpi-icon.warning {
    background: #8a6b2f;
}

.kayno-dashboard-chart-panel {
    min-height: 360px;
}

.kayno-dashboard-chart {
    direction: ltr;
    min-height: 250px;
}

.kayno-dashboard-chart.donut {
    max-width: 440px;
    margin: 0 auto;
}

.kayno-dashboard-table-panel {
    overflow: hidden;
}

.kayno-dashboard-table .mud-table-container {
    border-radius: 6px;
}

.kayno-terminal-transcript {
    direction: ltr;
    background: #111827;
    border: 1px solid #263241;
    border-radius: 6px;
    color: #d1d5db;
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
    min-height: 420px;
    max-height: 62vh;
    overflow: auto;
    padding: 14px;
}

.kayno-terminal-empty {
    color: #94a3b8;
    font-size: 0.9rem;
}

.kayno-terminal-command {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 10px 0;
}

.kayno-terminal-command:last-child {
    border-bottom: 0;
}

.kayno-terminal-prompt {
    align-items: center;
    color: #8fd3ff;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.kayno-terminal-command pre {
    background: transparent;
    color: #e5e7eb;
    font-family: inherit;
    font-size: 0.86rem;
    line-height: 1.5;
    margin: 0 0 8px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.kayno-terminal-command pre.stdout {
    color: #d1fae5;
}

.kayno-terminal-command pre.stderr {
    color: #fecaca;
}

.kayno-terminal-input input,
.kayno-terminal-input textarea,
.kayno-terminal-input .mud-input-slot {
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace !important;
}

.kayno-patch-progress {
    min-width: 140px;
    max-width: 220px;
    margin-bottom: 4px;
}

.kayno-empty-state {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #7b8790;
    background: #f8fafc;
    border: 1px dashed #cbd5dc;
    border-radius: 8px;
}

.kayno-empty-state.compact {
    min-height: 210px;
}

.kayno-empty-state .mud-icon-root {
    font-size: 2rem;
}

.kayno-tabs .mud-tabs-slider,
.kayno-tabs .mud-tab-slider,
.kayno-tabs .mud-tabs-slider-wrapper,
.mud-tabs .mud-tabs-slider,
.mud-tabs .mud-tab-slider,
.mud-tabs .mud-tabs-slider-wrapper {
    display: none !important;
}

.kayno-tabs .mud-tabs-toolbar,
.mud-tabs .mud-tabs-toolbar {
    border-bottom: 0 !important;
}

.kayno-tabs .mud-tab {
    min-height: 42px;
    border-radius: 6px;
    margin: 0 2px;
    color: #52616b;
}

.kayno-tabs .mud-tab:hover {
    background: #eef2f5;
}

.kayno-tabs .mud-tab.mud-tab-active {
    background: #e9f1f4;
    color: #1e2933;
}

.kayno-tabs-wrap .mud-tabs-toolbar {
    height: auto !important;
    min-height: 52px;
    overflow: visible !important;
}

.kayno-tabs-wrap .mud-tabs-tabbar,
.kayno-tabs-wrap .mud-tabs-tabbar-inner {
    height: auto !important;
    min-height: 52px;
    overflow: visible !important;
}

.kayno-tabs-wrap .mud-tabs-toolbar-content,
.kayno-tabs-wrap .mud-tabs-scroll-container,
.kayno-tabs-wrap .mud-tabs-scroll-container > div,
.kayno-tabs-wrap .mud-tabs-scroll,
.kayno-tabs-wrap .mud-tabs-tabbar-content,
.kayno-tabs-wrap .mud-tabs-tabbar-wrapper,
.kayno-tabs-wrap .mud-tabs-panels {
    max-width: 100%;
}

.kayno-tabs-wrap .mud-tabs-scroll-container,
.kayno-tabs-wrap .mud-tabs-scroll,
.kayno-tabs-wrap .mud-tabs-tabbar-content {
    height: auto !important;
    overflow: visible !important;
    white-space: normal !important;
}

.kayno-tabs-wrap .mud-tabs-scroll-button {
    display: none !important;
}

.kayno-tabs-wrap .mud-tabs-toolbar-content,
.kayno-tabs-wrap .mud-tabs-tabbar-wrapper {
    position: static !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    transform: none !important;
    transition: none !important;
}

.kayno-tabs-wrap .mud-tab {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
}

.kayno-os-logo {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #f8fafc;
    color: #2f5f7a;
}

.kayno-os-logo.large {
    width: 68px;
    height: 68px;
}

.kayno-os-logo.compact {
    width: 42px;
    height: 42px;
}

.kayno-os-logo svg {
    width: 34px;
    height: 34px;
}

.kayno-os-logo.large svg {
    width: 44px;
    height: 44px;
}

.kayno-os-logo.compact svg {
    width: 26px;
    height: 26px;
}

.kayno-os-logo.windows,
.kayno-os-logo.windows-11 {
    color: #0078d4;
    background: #eef7fc;
}

.kayno-os-logo.windows-10 {
    color: #00a4ef;
    background: #edf8fd;
}

.kayno-os-logo.windows-8 {
    color: #0085c7;
    background: #edf6fb;
}

.kayno-os-logo.windows-7 {
    color: #2674b8;
    background: #edf4fa;
}

.kayno-os-logo.linux {
    color: #384047;
    background: #f2f4f5;
}

.kayno-os-logo.ubuntu {
    color: #dd4814;
    background: #fff1eb;
}

.kayno-os-logo.debian {
    color: #a80030;
    background: #fff0f4;
}

.kayno-system-card {
    min-height: 292px;
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.kayno-system-card.online {
    border-right: 4px solid #2e7d5b;
}

.kayno-system-card.offline {
    border-right: 4px solid #a9bac3;
}

.kayno-system-card:hover {
    border-color: #b8c7d0;
    box-shadow: 0 8px 22px rgba(30, 41, 51, .08);
    transform: translateY(-1px);
}

.kayno-system-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.kayno-system-card-grid div {
    min-width: 0;
}

.kayno-system-card-grid span {
    display: block;
    color: #5b6873;
    font-size: .76rem;
    margin-bottom: 4px;
}

.kayno-system-card-grid strong {
    display: block;
    color: #1e2933;
    font-size: .88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kayno-system-detail-hero,
.kayno-system-chart-panel {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #ffffff;
}

.kayno-system-detail-hero {
    background: #f8fafc;
}

.kayno-system-chart-panel {
    min-height: 350px;
}

.kayno-user-scope-panel {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #f8fafc;
}

.kayno-user-scope-card {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #ffffff;
}

.kayno-assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.kayno-assignment-card {
    border: 1px solid #d9e0e5;
    border-radius: 8px;
    background: #ffffff;
}

.kayno-assignment-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.kayno-assignment-summary span {
    min-width: 0;
    border: 1px solid #e4eaee;
    border-radius: 6px;
    background: #f8fafc;
    color: #43515c;
    font-size: .78rem;
    padding: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 960px) {
    .kayno-dashboard-header .mud-stack-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .kayno-system-detail-hero .mud-stack-row {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .kayno-system-card-grid {
        grid-template-columns: 1fr;
    }
}
