:root {
    color-scheme: light;
    --ink: #241c31;
    --muted: #655c72;
    --background: #f7f5f9;
    --surface: #fff;
    --border: #e8e1ee;
    --brand: #664491;
    --brand-dark: #4a316d;
    --brand-soft: #efe6f7;
    --success: #1e6849;
    --danger: #842b49;
    font-family: "Noto Sans Armenian", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button {
    border: 1px solid var(--border); background: var(--surface); border-radius: 9px;
    padding: .62rem .93rem; min-height: 39px; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; gap: .45rem; font-weight: 600;
    white-space: nowrap; color: var(--ink);
}
button:hover, .button:hover { border-color: #b9a5ca; text-decoration: none; }
.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
:focus-visible { outline: 3px solid #9a75bd; outline-offset: 2px; }
input, select, textarea {
    min-width: 0; width: 100%; background: var(--surface); border: 1px solid #dcd3e5;
    border-radius: 8px; padding: .64rem .74rem;
}
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--brand); }
textarea { resize: vertical; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.45rem); line-height: 1.22; letter-spacing: -.035em; margin-bottom: 0; }
h2 { font-size: 1.14rem; line-height: 1.4; margin-bottom: .95rem; }
svg { width: 1.2rem; height: 1.2rem; flex: none; vertical-align: middle; }

.shell { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
    background: #fff; border-right: 1px solid var(--border); padding: 19px 13px 22px;
    height: 100dvh; overflow-y: auto; position: sticky; top: 0;
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 6px 8px 16px; }
.brand img { max-width: 151px; width: 76%; height: auto; }
.brand span, .auth-brand span { font-weight: 800; letter-spacing: .11em; color: var(--brand-dark); }
.nav-group { padding: 18px 9px 6px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 7px 9px;
    color: #43374f; border-radius: 7px; font-size: .87rem; font-weight: 550;
}
.sidebar nav a:hover { background: #f6f0fa; text-decoration: none; }
.sidebar nav a[aria-current="page"] { color: var(--brand-dark); background: var(--brand-soft); font-weight: 750; }
.sidebar nav svg { color: var(--brand); }
.topbar {
    background: #fff; border-bottom: 1px solid var(--border); padding: 11px clamp(16px, 3vw, 35px);
    min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.company { font-weight: 700; font-size: .95rem; }
.account { display: flex; align-items: center; gap: 10px; }
.account strong, .account small { display: block; }
.account small, small { color: var(--muted); }
.account button { margin-left: .35rem; min-height: 33px; padding: .32rem .72rem; }
.avatar, .metric-icon { display: grid; place-items: center; color: var(--brand-dark); background: var(--brand-soft); border-radius: 11px; width: 36px; height: 36px; }
.mobile-nav { display: none; }
.main { max-width: 1500px; margin: 0 auto; padding: 27px clamp(16px, 3vw, 35px) 48px; }
.heading { margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 19px; margin-bottom: 16px; box-shadow: 0 2px 8px #31194c06; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric { display: grid; align-content: start; gap: 9px; margin: 0; color: var(--ink); }
.metric:hover { border-color: #b9a5ca; text-decoration: none; }
.metric span:not(.metric-icon) { color: var(--muted); font-size: .87rem; }
.metric strong { font-size: 2.13rem; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.pipeline, .recent {
    border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 9px 0; overflow-wrap: anywhere;
}
.pipeline { display: grid; grid-template-columns: minmax(7rem,1.25fr) minmax(3rem,2fr) 2rem; color: var(--ink); font-size: .88rem; }
.pipeline strong { text-align: right; }
progress { width: 100%; height: 9px; appearance: none; color: var(--brand); accent-color: var(--brand); border: 0; border-radius: 999px; overflow: hidden; background: var(--brand-soft); }
progress::-webkit-progress-bar { background: var(--brand-soft); }
progress::-webkit-progress-value { background: var(--brand); }
.recent small { display: block; }
.recent strong { display: block; }
.pill { display: inline-block; white-space: nowrap; font-size: .78rem; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; padding: .22rem .56rem; }
.muted, .empty { color: var(--muted); }
.empty { padding: 13px 0 3px; margin-bottom: 9px; }
.text-link { font-weight: 700; }
.toolbar, .filters, .pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 15px; }
.filters input[type="search"], .filters select { flex: 1 1 170px; width: auto; }
.toolbar input[type="file"] { width: min(430px,100%); }
.pagination { margin: 14px 0 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .72rem .66rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f8f5fa; color: #534462; font-size: .79rem; white-space: nowrap; }
td { font-size: .88rem; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px 15px; }
.form-grid label, .card > label, .chat-form label { display: grid; align-content: start; gap: 5px; font-weight: 600; font-size: .9rem; }
.form-grid .check, .check { display: flex; align-items: center; gap: 7px; }
.span-all, .form-actions { grid-column: 1/-1; }
.form-actions { display: flex; gap: 9px; }
.inline-action { margin-top: 13px; }
.alert { padding: .78rem .92rem; border-radius: 8px; border: 1px solid #d2eadc; background: #ecf8f0; color: var(--success); }
.alert.error { color: var(--danger); background: #fceff3; border-color: #f0d1dc; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px,1fr); gap: 11px; overflow-x: auto; padding-bottom: 12px; }
.board-column { background: #eee7f3; padding: 13px; border-radius: 10px; }
.board-record { display: block; background: #fff; border-radius: 8px; margin-bottom: 8px; padding: 8px; overflow-wrap: anywhere; }
.calendar { display: grid; grid-template-columns: repeat(7,minmax(90px,1fr)); gap: 4px; min-width: 645px; }
.calendar > strong { text-align: center; }
.day { border: 1px solid var(--border); border-radius: 7px; min-height: 74px; padding: 6px; }
.day a { display: block; font-size: .78rem; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message { padding: 10px 0; border-bottom: 1px solid var(--border); }
.chat-message header { display: flex; gap: 10px; align-items: baseline; }
.chat-message p { margin: 5px 0; }
.chat-form { display: grid; justify-items: start; gap: 9px; margin-top: 15px; }
.chat-form label { width: 100%; }

.auth { max-width: 725px; padding: 40px 16px; margin: 0 auto; }
.auth-brand { display: flex; align-items: center; gap: 13px; margin: 0 0 18px; }
.auth-brand img { width: 190px; height: auto; }
.auth-card { max-width: 690px; background: #fff; border-radius: 16px; border: 1px solid var(--border); padding: clamp(19px,4vw,33px); box-shadow: 0 8px 32px #31194c10; }
.auth-card h1 { margin-bottom: 18px; }
.auth-card > .form-grid { grid-template-columns: minmax(0,1fr); }
.auth-card fieldset { min-width: 0; border: 1px solid var(--border); border-radius: 9px; padding: 11px; margin: 0; }
.auth-card legend { color: var(--brand-dark); font-weight: 650; }

@media (max-width: 1050px) {
    .shell { grid-template-columns: 202px minmax(0,1fr); }
    .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
    .shell { display: block; }
    .sidebar { display: none; position: fixed; inset: 57px auto 0 0; width: min(270px,88vw); height: auto; z-index: 2; box-shadow: 8px 0 25px #20192e1c; }
    .sidebar.open { display: block; }
    .topbar { min-height: 57px; padding: 7px 11px; gap: 8px; }
    .topbar .company, .account .avatar { display: none; }
    .account small { display: none; }
    .mobile-nav { display: inline-flex; }
    .main { padding-top: 19px; }
    .overview-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
    .card { padding: 13px; }
    .form-grid { grid-template-columns: minmax(0,1fr); }
}
