:root {
    --bg: #f5f1ea;
    --panel: #ffffff;
    --panel-soft: #f9f6f0;
    --text: #1f2933;
    --muted: #6b7280;
    --primary: #b45309;
    --primary-dark: #92400e;
    --warning: #b91c1c;
    --border: #e5ddd0;
    --shadow: 0 18px 40px rgba(80, 56, 20, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(180, 83, 9, 0.14), transparent 24%),
        linear-gradient(180deg, #fcfaf7 0%, var(--bg) 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    z-index: 10;
}

.brand {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
}

.brand-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topnav a {
    color: var(--primary-dark);
    font-weight: 700;
}

.nav-with-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--warning);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.subtitle,
.muted {
    color: var(--muted);
}

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.banner {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 600;
}

.banner.success {
    background: #ecfdf3;
    color: #166534;
}

.banner.error {
    background: #fef2f2;
    color: #991b1b;
}

.auth-shell,
.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.auth-card,
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.screen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.stack,
.stack-gap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-grid,
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.filter-grid,
.kpi-grid,
.metric-grid,
.action-panels,
.ranking-columns {
    display: grid;
    gap: 14px;
}

.filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 18px 0;
}

.metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.ranking-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label span {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
}

textarea {
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 700;
}

.button.primary {
    background: var(--primary);
    color: white;
}

.button.secondary {
    background: #fff8ef;
    color: var(--primary-dark);
    border: 1px solid #f1d5b5;
}

.button.warning {
    background: #fee2e2;
    color: #991b1b;
}

.button.small {
    padding: 8px 12px;
    font-size: 13px;
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-actions,
.row-actions,
.action-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: right;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 14px;
}

.status {
    display: inline-flex;
    padding: 8px 12px;
    background: #fff6e8;
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-clickable {
    cursor: pointer;
}

.status-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-editor summary {
    list-style: none;
}

.status-editor summary::-webkit-details-marker {
    display: none;
}

.status-editor-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 220px;
}

.status-editor-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.status-editor-extra.is-hidden {
    display: none;
}

.case-name-trigger {
    border: none;
    background: transparent;
    color: var(--primary-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.case-name-trigger:hover,
.case-name-trigger.is-active {
    color: var(--primary);
    transform: translateY(-1px);
}

.quick-card-row td {
    padding: 0;
    border-bottom: none;
}

.quick-card-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-12px);
    transition: max-height 0.35s ease, opacity 0.26s ease, transform 0.26s ease, margin 0.26s ease, padding 0.26s ease;
    margin: 0;
    padding: 0 18px;
}

.quick-card-row.is-open .quick-card-panel {
    max-height: 1200px;
    opacity: 1;
    transform: translateY(0);
    margin: 12px 0 18px;
    padding: 20px 18px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
    box-shadow: 0 22px 44px rgba(84, 57, 28, 0.08);
}

.quick-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.quick-card-head h3,
.quick-card-section h4 {
    margin: 0;
}

.quick-card-grid {
    align-items: start;
}

.quick-card-section {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-visual-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.quick-visual-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quick-visual-frame {
    display: block;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #fbf8f2 0%, #f3ede3 100%);
    min-height: 220px;
    max-height: 320px;
}

.quick-visual-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 320px;
    object-fit: contain;
    background: #f9f6ef;
}

.quick-visual-caption {
    margin: 0;
}

.quick-visual-empty {
    min-height: 220px;
    border-radius: 18px;
    border: 1px dashed var(--border);
    background: linear-gradient(180deg, #fdfaf6 0%, #f6f0e7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted);
}

.quick-files-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.quick-subsection {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.quick-files-block h5 {
    margin: 0;
    font-size: 14px;
    color: var(--primary-dark);
}

.quick-files-list {
    max-height: 220px;
    overflow-y: auto;
}

.quick-file-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quick-chat-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.quick-chat-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-left: 2px;
}

.quick-chat-item {
    display: block;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.quick-chat-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.quick-chat-item p {
    margin: 0;
    white-space: pre-wrap;
}

.state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
}

.state-pill.success {
    background: #ecfdf3;
    color: #166534;
    border-color: #a7f3d0;
}

.state-pill.warning {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fdba74;
}

.state-pill.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fca5a5;
}

.state-pill.neutral {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.history-details {
    margin-bottom: 12px;
}

.history-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.history-summary::-webkit-details-marker {
    display: none;
}

.history-summary-open {
    display: none;
}

.history-details[open] .history-summary-closed {
    display: none;
}

.history-details[open] .history-summary-open {
    display: inline;
}

.history-details:not([open]) .history-full {
    display: none;
}

.history-details[open] + .history-recent-collapsible {
    display: none;
}

.kpi-card,
.metric-tile,
.queue-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-label {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.kpi-value,
.metric-value {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
}

.metric-tile {
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.timeline-item,
.list-item {
    display: block;
    padding: 14px;
    border-radius: 16px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plain-list {
    margin: 0;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.case-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ranking-group {
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.ranking-group h3 {
    margin: 0 0 6px;
}

.ranking-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-list li {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
}

.ranking-rank {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff1db;
    color: var(--primary-dark);
    font-weight: 800;
}

.person-link {
    color: var(--primary-dark);
    font-weight: 700;
}

.queue-item {
    padding: 14px;
    border-radius: 16px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.sla-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.sla-indicator.green {
    background: #dcfce7;
    color: #166534;
}

.sla-indicator.orange {
    background: #ffedd5;
    color: #9a3412;
}

.sla-indicator.red {
    background: #fee2e2;
    color: #991b1b;
}

.sla-indicator.neutral {
    background: #e5e7eb;
    color: #374151;
}

.metric-badge {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    border-right: 4px solid transparent;
}

.notification-unread {
    border-right-color: var(--primary);
    background: #fffaf1;
}

.filter-summary {
    margin: 12px 0 0;
}

.demo-list {
    margin: 0;
    padding-right: 18px;
    line-height: 1.9;
}

@media (max-width: 980px) {
    .auth-shell,
    .grid-two,
    .form-grid,
    .info-grid,
    .filter-grid,
    .kpi-grid,
    .metric-grid,
    .action-panels,
    .ranking-columns {
        grid-template-columns: 1fr;
    }

    .topbar,
    .screen-head,
    .section-head {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Premium SaaS Redesign Layer */

:root {
    --bg: #f3efe9;
    --bg-canvas: #f7f4ef;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-strong: #ffffff;
    --panel-soft: #faf7f2;
    --panel-muted: #f3ece3;
    --text: #171614;
    --text-soft: #6a6257;
    --primary: #b57e45;
    --primary-dark: #8c6132;
    --primary-soft: #f7ebde;
    --success: #1f6b4f;
    --success-soft: #e8f5ef;
    --warning: #9f5634;
    --warning-soft: #fff1e7;
    --danger: #b24343;
    --danger-soft: #fdeeee;
    --info: #54667a;
    --info-soft: #eef3f7;
    --border: #e5ddd2;
    --border-strong: #d6c9ba;
    --shadow: 0 24px 70px rgba(39, 30, 21, 0.08);
    --shadow-soft: 0 16px 40px rgba(33, 24, 17, 0.06);
    --sidebar-bg: linear-gradient(180deg, #121110 0%, #181614 40%, #211d1a 100%);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(181, 126, 69, 0.08), transparent 18%),
        radial-gradient(circle at top right, rgba(0, 0, 0, 0.06), transparent 22%),
        linear-gradient(180deg, #fbf8f4 0%, var(--bg) 100%);
    color: var(--text);
    font-family: "Segoe UI", "Arial", sans-serif;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: row-reverse;
}

.app-sidebar {
    width: 300px;
    flex: 0 0 300px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #f6efe8;
    padding: 28px 22px;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
    padding: 8px 6px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #fffaf3;
}

.brand-mark {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-tagline {
    color: rgba(255, 243, 228, 0.68);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-link {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 12px;
    border-radius: 20px;
    color: rgba(255, 246, 235, 0.78);
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(229, 221, 210, 0.14);
    color: #fff9f1;
    transform: translateY(-1px);
}

.sidebar-link-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f0d9bc;
    font-size: 14px;
}

.sidebar-link-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sidebar-link-copy strong {
    font-size: 15px;
    font-weight: 700;
}

.sidebar-link-copy small {
    color: rgba(255, 243, 228, 0.56);
    font-size: 12px;
}

.sidebar-link-badge {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(180deg, #d48d54 0%, #b97231 100%);
    color: white;
    font-size: 12px;
    font-weight: 800;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff5e8;
    font-weight: 800;
    font-size: 18px;
}

.sidebar-user-card small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 243, 228, 0.56);
}

.sidebar-logout {
    width: 100%;
    background: rgba(255, 248, 239, 0.1);
    color: #fff4e6;
    border-color: rgba(255, 255, 255, 0.12);
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: 22px 26px 34px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    margin-bottom: 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(229, 221, 210, 0.8);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 18px;
    z-index: 12;
}

.header-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(247, 244, 239, 0.92);
    padding: 10px 14px;
}

.header-search input {
    border: none;
    background: transparent;
    padding: 0;
    color: var(--text-soft);
    cursor: not-allowed;
}

.header-search input:disabled {
    opacity: 1;
    color: var(--text-soft);
}

.header-search-icon {
    color: var(--primary-dark);
    font-size: 15px;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-notification-chip,
.header-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
}

.header-notification-count {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(180deg, #d48d54 0%, #b97231 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.header-user-chip {
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.header-user-name {
    font-weight: 700;
}

.header-user-role {
    color: var(--text-soft);
    font-size: 12px;
}

.auth-page {
    min-height: 100vh;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0;
}

.page-hero {
    margin-bottom: 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 245, 238, 0.9) 100%);
}

.screen-head {
    padding: 28px 30px;
    border-radius: 32px;
    border: 1px solid rgba(229, 221, 210, 0.88);
    background: var(--panel);
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eyebrow {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.screen-head h1,
.screen-head h2,
.screen-head h3 {
    margin: 0;
    font-size: clamp(30px, 3vw, 44px);
    line-height: 1.05;
    color: #161412;
}

.screen-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    align-items: center;
}

.hero-stat-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(17, 17, 17, 0.03);
    border: 1px solid var(--border);
}

.hero-stat-chip span,
.hero-status-cluster .soft-chip {
    color: var(--text-soft);
    font-size: 12px;
}

.hero-stat-chip strong {
    font-size: 26px;
    color: var(--primary-dark);
}

.hero-status-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.soft-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.card,
.auth-card,
.summary-card {
    background: var(--panel);
    border: 1px solid rgba(229, 221, 210, 0.86);
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
}

.card,
.auth-card {
    padding: 24px;
}

.section-card {
    padding: 26px;
}

.section-head {
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 0;
    font-size: 26px;
}

.section-head p,
.screen-head p,
.muted,
.subtitle {
    color: var(--text-soft);
}

.banner {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    font-weight: 600;
}

.banner.success {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(31, 107, 79, 0.18);
}

.banner.error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(178, 67, 67, 0.16);
}

.form-grid,
.info-grid,
.filter-grid,
.kpi-grid,
.metric-grid,
.action-panels,
.ranking-columns,
.hero-summary-grid {
    display: grid;
    gap: 16px;
}

.form-grid,
.info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-grid,
.hero-summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-panels,
.ranking-columns,
.grid-two,
.detail-layout {
    display: grid;
    gap: 22px;
}

.grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
}

.content-subgrid {
    margin-top: 2px;
}

.full-width {
    grid-column: 1 / -1;
}

label span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
    margin-bottom: 8px;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #fcfbf9 0%, #f8f4ee 100%);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(181, 126, 69, 0.54);
    box-shadow: 0 0 0 4px rgba(181, 126, 69, 0.08);
    background: #fff;
}

textarea {
    resize: vertical;
}

.button {
    border-radius: 18px;
    padding: 12px 18px;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(180deg, #c1894d 0%, #a86d34 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(168, 109, 52, 0.22);
}

.button.secondary {
    background: linear-gradient(180deg, #fffdf9 0%, #f8f2ea 100%);
    color: var(--primary-dark);
    border: 1px solid rgba(181, 126, 69, 0.25);
}

.button.warning {
    background: linear-gradient(180deg, #fff5f3 0%, #fce6e1 100%);
    color: var(--danger);
    border: 1px solid rgba(178, 67, 67, 0.18);
}

.button.ghost {
    background: transparent;
    color: var(--text-soft);
    border: 1px dashed rgba(140, 97, 50, 0.28);
}

.button.small {
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 14px;
}

.form-actions,
.row-actions,
.action-list,
.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-card {
    margin-bottom: 24px;
}

.filter-toolbar {
    align-items: end;
}

.filter-actions {
    align-self: end;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

thead th {
    padding: 0 14px 10px;
    border: none;
    color: var(--text-soft);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tbody td {
    padding: 18px 14px;
    border-top: 1px solid rgba(229, 221, 210, 0.9);
    border-bottom: 1px solid rgba(229, 221, 210, 0.9);
    background: rgba(255, 255, 255, 0.84);
    vertical-align: middle;
}

tbody tr td:first-child {
    border-right: 1px solid rgba(229, 221, 210, 0.9);
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

tbody tr td:last-child {
    border-left: 1px solid rgba(229, 221, 210, 0.9);
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

tbody tr.data-row:hover td {
    background: #fffdf9;
}

.quick-card-row td {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.table-identity,
.table-meta-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.table-primary-link {
    font-weight: 800;
    color: #171614;
}

.table-secondary-text {
    color: var(--text-soft);
    font-size: 12px;
}

.status,
.state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid transparent;
}

.status {
    background: #f0ebe3;
    color: #58483a;
}

.status-draft,
.status-returned-for-completion,
.status-returned-for-decomposition-fix {
    background: #f2ede6;
    color: #645446;
}

.status-submitted-for-review,
.status-ready-for-assignment,
.status-managerial-review {
    background: #fff0df;
    color: #9a5a28;
}

.status-assigned-to-decomposer,
.status-received-by-decomposer,
.status-in-decomposition,
.status-returned-from-designer {
    background: #eef3f7;
    color: #40566d;
}

.status-blocked-waiting-designer {
    background: #fdeeee;
    color: #a23e3e;
}

.status-decomposition-completed,
.status-approved-for-factory-transfer,
.status-sent-to-factory,
.status-closed {
    background: #e8f5ef;
    color: #1f6b4f;
}

.state-pill.success {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(31, 107, 79, 0.2);
}

.state-pill.warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: rgba(159, 86, 52, 0.2);
}

.state-pill.error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(178, 67, 67, 0.2);
}

.state-pill.neutral {
    background: var(--panel-soft);
    color: var(--text-soft);
    border-color: var(--border);
}

.quick-card-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-12px);
    transition: max-height 0.35s ease, opacity 0.26s ease, transform 0.26s ease, margin 0.26s ease, padding 0.26s ease;
    margin: 0;
    padding: 0 12px;
}

.quick-card-row.is-open .quick-card-panel {
    max-height: 2400px;
    opacity: 1;
    transform: translateY(0);
    margin: 14px 0 20px;
    padding: 22px;
    border-radius: 30px;
    border: 1px solid rgba(229, 221, 210, 0.9);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(248, 244, 237, 0.9) 100%);
    box-shadow: var(--shadow);
}

.quick-card-head {
    margin-bottom: 20px;
}

.quick-card-grid {
    grid-template-columns: 1.02fr 0.98fr;
    align-items: start;
}

.quick-card-section {
    gap: 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
}

.compact-info-grid div,
.fact-grid div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border-radius: 20px;
    background: var(--panel-soft);
    border: 1px solid rgba(229, 221, 210, 0.86);
}

.compact-info-grid strong,
.fact-grid strong {
    color: var(--text-soft);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.compact-info-grid span,
.fact-grid span {
    color: var(--text);
    font-weight: 700;
}

.quick-visual-block {
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
}

.quick-subsection,
.quick-chat-block,
.quick-files-block {
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.quick-visual-frame {
    background: linear-gradient(180deg, #f8f3eb 0%, #eee5d8 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.quick-chat-item,
.timeline-item,
.queue-item,
.ranking-group,
.metric-tile,
.list-item,
.notification-card,
.summary-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(249, 245, 238, 0.94) 100%);
    border: 1px solid rgba(229, 221, 210, 0.84);
}

.summary-card {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-label {
    color: var(--text-soft);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.summary-card strong {
    font-size: 24px;
    line-height: 1.1;
}

.summary-card small {
    color: var(--text-soft);
}

.kpi-card,
.premium-kpi-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    gap: 10px;
}

.kpi-accent {
    width: 42px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #171614 0%, #b57e45 100%);
}

.kpi-value,
.metric-value {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    color: #181410;
}

.premium-metric-tile {
    padding: 18px;
    border-radius: 22px;
}

.ranking-group {
    padding: 18px;
    border-radius: 24px;
}

.ranking-rank {
    background: linear-gradient(180deg, #fff2e2 0%, #f1dcc0 100%);
    border: 1px solid rgba(181, 126, 69, 0.18);
}

.person-link {
    font-weight: 800;
}

.case-queue,
.notification-stack,
.timeline,
.list,
.ranking-stack {
    gap: 14px;
}

.queue-item,
.timeline-item,
.list-item,
.notification-card {
    padding: 16px 18px;
    border-radius: 22px;
}

.queue-item strong,
.timeline-item strong,
.notification-card h3 {
    color: #171614;
}

.timeline-head,
.quick-chat-head,
.notification-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    color: var(--text-soft);
    font-size: 12px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.action-card {
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(229, 221, 210, 0.84);
    background: linear-gradient(180deg, #fffdfa 0%, #f8f3ec 100%);
}

.executive-alert-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.executive-alert-item {
    padding: 16px 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(26, 22, 18, 0.94) 0%, rgba(39, 32, 27, 0.96) 100%);
    color: #fff5e8;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.executive-alert-item span {
    display: block;
    color: rgba(255, 243, 228, 0.65);
    font-size: 12px;
    margin-bottom: 8px;
}

.executive-alert-item strong {
    font-size: 28px;
    font-family: Georgia, "Times New Roman", serif;
}

.executive-queue-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-card {
    position: relative;
}

.notification-card.is-unread {
    background: linear-gradient(180deg, #fffaf3 0%, #fff4e6 100%);
    border-color: rgba(181, 126, 69, 0.34);
}

.notification-state {
    display: inline-flex;
    margin-bottom: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(181, 126, 69, 0.1);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.notification-time,
.notification-type {
    color: var(--text-soft);
}

.auth-shell {
    width: min(1320px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.95fr);
    gap: 24px;
    align-items: stretch;
}

.auth-brand-panel {
    position: relative;
    border-radius: 34px;
    overflow: hidden;
    min-height: 720px;
    background:
        radial-gradient(circle at top left, rgba(181, 126, 69, 0.18), transparent 28%),
        linear-gradient(145deg, #111110 0%, #1a1714 42%, #25201c 100%);
    color: #fff8f0;
    padding: 44px;
    box-shadow: var(--shadow);
}

.auth-brand-inner {
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-brand-inner h1 {
    margin: 0;
    font-size: clamp(42px, 4vw, 66px);
    line-height: 0.95;
    font-family: Georgia, "Times New Roman", serif;
}

.auth-feature-list {
    display: grid;
    gap: 14px;
    margin-top: auto;
}

.auth-feature {
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-feature span {
    color: rgba(255, 248, 240, 0.7);
}

.premium-auth-card {
    padding: 34px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-card-head h2,
.auth-demo-panel h3 {
    margin: 0 0 8px;
}

.auth-support-panel,
.auth-demo-panel {
    padding: 18px;
    border-radius: 22px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.demo-list {
    padding-right: 18px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
}

.attachment-check {
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.history-summary {
    margin-bottom: 12px;
}

.history-details[open] .history-full {
    margin-top: 10px;
}

.data-table code,
code {
    font-family: Consolas, monospace;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 8px;
    background: #f3efe9;
}

.plain-list {
    gap: 12px;
}

.plain-list li {
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.sla-indicator.green {
    background: var(--success-soft);
    color: var(--success);
}

.sla-indicator.orange {
    background: var(--warning-soft);
    color: var(--warning);
}

.sla-indicator.red {
    background: var(--danger-soft);
    color: var(--danger);
}

.sla-indicator.neutral {
    background: var(--panel-muted);
    color: var(--text-soft);
}

@media (max-width: 1320px) {
    .kpi-grid,
    .hero-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .executive-alert-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1160px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        height: auto;
    }

    .app-main {
        padding-top: 18px;
    }

    .detail-layout,
    .auth-shell,
    .grid-two,
    .action-panels,
    .ranking-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .app-header,
    .screen-head {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-grid,
    .form-grid,
    .info-grid,
    .kpi-grid,
    .metric-grid,
    .hero-summary-grid,
    .action-grid,
    .executive-alert-bar {
        grid-template-columns: 1fr;
    }

    .header-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-page {
        padding: 18px;
    }

    .auth-brand-panel,
    .premium-auth-card {
        padding: 24px;
    }

    .screen-head h1 {
        font-size: 34px;
    }
}

/* Premium SaaS Refinement Pass */

.brand-emblem {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(181, 126, 69, 0.18) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff6ea;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.sidebar-section-label,
.sidebar-system-label,
.header-system-copy {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
}

.sidebar-section-label {
    color: rgba(255, 243, 228, 0.42);
    padding: 0 8px;
    margin-top: 4px;
}

.sidebar-system-label {
    color: rgba(255, 243, 228, 0.46);
}

.header-system-chip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 180px;
}

.header-system-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.header-system-copy {
    color: var(--text-soft);
}

.header-search-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-notification-icon,
.sidebar-link-icon::before {
    display: block;
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 4px;
}

.icon-cases::before {
    border-radius: 3px;
    box-shadow: inset 0 4px 0 0 currentColor, inset 0 -4px 0 0 transparent;
}

.icon-control::before {
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(240, 217, 188, 0.12);
}

.icon-bell::before,
.header-notification-icon {
    border-radius: 7px 7px 5px 5px;
}

.icon-gmail::before {
    border-radius: 4px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, 50% 52%);
}

.app-sidebar {
    width: 332px;
    flex-basis: 332px;
    padding: 34px 24px 26px;
    gap: 28px;
}

.sidebar-brand {
    padding: 2px 8px 22px;
}

.brand-logo {
    gap: 8px;
}

.brand-mark {
    font-size: 38px;
}

.sidebar-nav {
    gap: 12px;
}

.sidebar-link {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 16px 16px 16px 14px;
    border-radius: 22px;
}

.sidebar-link.is-active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(181, 126, 69, 0.08) 100%);
    border-color: rgba(255, 236, 214, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-link-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.sidebar-link-copy strong {
    font-size: 15px;
}

.sidebar-footer {
    gap: 16px;
    padding: 20px 8px 0;
}

.app-main {
    padding: 28px 32px 40px;
}

.app-header {
    padding: 18px 22px;
    border-radius: 30px;
    margin-bottom: 28px;
}

.header-search {
    max-width: 560px;
    width: 100%;
    min-height: 56px;
    border-radius: 22px;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(250, 247, 242, 0.98) 0%, rgba(245, 239, 232, 0.96) 100%);
}

.header-meta {
    gap: 14px;
}

.header-notification-chip,
.header-user-chip {
    min-height: 56px;
    border-radius: 20px;
    padding: 11px 16px;
}

.header-user-chip {
    min-width: 170px;
}

.workspace-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) 320px;
    gap: 24px;
    align-items: start;
}

.workspace-main,
.workspace-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.workspace-side {
    position: sticky;
    top: 112px;
}

.side-panel {
    padding: 24px;
}

.side-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.side-panel-head h3 {
    margin: 4px 0 0;
    font-size: 22px;
}

.side-stat-list,
.side-link-list,
.side-notes-list {
    display: grid;
    gap: 12px;
}

.side-stat-item,
.side-link,
.side-notes-list li {
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 244, 237, 0.94) 100%);
    border: 1px solid rgba(229, 221, 210, 0.84);
}

.side-stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-stat-item strong {
    font-size: 28px;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--primary-dark);
}

.side-stat-item span,
.side-link span,
.side-notes-list li {
    color: var(--text-soft);
}

.side-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.side-link:hover {
    transform: translateY(-2px);
    border-color: rgba(181, 126, 69, 0.28);
    box-shadow: var(--shadow-soft);
}

.side-link strong {
    color: var(--text);
}

.side-notes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.action-strip-card {
    padding: 20px 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(181, 126, 69, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 243, 236, 0.98) 100%);
}

.action-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.action-strip-copy h2 {
    margin: 4px 0 8px;
    font-size: 30px;
}

.action-strip-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.action-metric {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(229, 221, 210, 0.72);
}

.action-metric span {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
    margin-bottom: 8px;
}

.action-metric strong {
    font-size: 28px;
    font-family: Georgia, "Times New Roman", serif;
}

.action-strip-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.premium-filter-card {
    padding: 24px 24px 18px;
}

.premium-filter-toolbar {
    gap: 14px;
}

.premium-filter-toolbar label {
    background: var(--panel-soft);
    border: 1px solid rgba(229, 221, 210, 0.9);
    border-radius: 20px;
    padding: 12px 14px;
}

.premium-filter-toolbar label span {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.premium-filter-toolbar select,
.premium-filter-toolbar input {
    min-height: 46px;
    background: #fff;
}

.premium-table-card {
    padding: 24px;
}

.premium-table-wrap {
    background: linear-gradient(180deg, rgba(249, 245, 239, 0.98) 0%, rgba(244, 238, 230, 0.98) 100%);
    border-radius: 30px;
    padding: 16px;
    border: 1px solid rgba(229, 221, 210, 0.92);
}

.premium-data-table {
    border-collapse: separate;
    border-spacing: 0 12px;
}

.premium-data-table thead th,
.data-table thead th {
    background: linear-gradient(180deg, #201c19 0%, #2b2622 100%);
    color: #f8efe3;
    border: none;
    padding: 18px 18px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.premium-data-table thead th:first-child,
.data-table thead th:first-child {
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
}

.premium-data-table thead th:last-child,
.data-table thead th:last-child {
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
}

.premium-data-table tbody tr td,
.data-table tbody tr td {
    padding: 18px 18px;
}

.data-table tbody tr.data-row:hover td {
    background: linear-gradient(180deg, #fffdf9 0%, #fbf6ef 100%);
}

.cases-hero,
.dashboard-hero,
.detail-hero {
    margin-bottom: 0;
}

.manager-workspace .workspace-main {
    gap: 24px;
}

.executive-side-panel {
    background:
        radial-gradient(circle at top left, rgba(181, 126, 69, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 241, 232, 0.98) 100%);
}

.notification-stack {
    display: grid;
    gap: 14px;
}

.notification-card {
    padding: 24px;
    border-radius: 24px;
}

.notification-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.detail-layout {
    gap: 24px;
}

.content-subgrid,
.dashboard-grid,
.action-panels,
.ranking-columns {
    gap: 24px;
}

.hero-summary-grid {
    gap: 18px;
}

.summary-card {
    min-height: 150px;
    justify-content: space-between;
}

.auth-shell {
    gap: 28px;
}

.auth-brand-panel {
    border-radius: 36px;
    min-height: 760px;
}

.premium-auth-card {
    border-radius: 36px;
}

@media (max-width: 1440px) {
    .workspace-layout {
        grid-template-columns: 1fr 290px;
    }

    .action-strip {
        grid-template-columns: 1fr;
    }

    .action-strip-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1200px) {
    .workspace-layout {
        grid-template-columns: 1fr;
    }

    .workspace-side {
        position: relative;
        top: 0;
    }

    .action-strip-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .app-sidebar {
        width: 100%;
        flex-basis: auto;
    }

    .app-main {
        padding: 18px;
    }

    .header-search-wrap,
    .header-system-chip {
        width: 100%;
    }

    .action-strip-metrics {
        grid-template-columns: 1fr;
    }
}

/* Premium SaaS Final Polish */

body {
    background:
        radial-gradient(circle at top left, rgba(181, 126, 69, 0.12), transparent 18%),
        radial-gradient(circle at 88% 8%, rgba(0, 0, 0, 0.08), transparent 20%),
        linear-gradient(180deg, #fcfaf6 0%, #f1ebe2 100%);
}

.page {
    max-width: 1660px;
}

.app-shell {
    display: flex;
    flex-direction: row-reverse;
    direction: ltr;
    align-items: stretch;
}

.app-sidebar {
    flex: 0 0 332px;
    position: sticky;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(181, 126, 69, 0.16), transparent 22%),
        linear-gradient(180deg, #0f0e0d 0%, #161412 48%, #1e1a17 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 28px 0 50px rgba(17, 13, 9, 0.12);
}

.app-sidebar,
.app-main {
    direction: rtl;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-sidebar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(181, 126, 69, 0.16), rgba(255, 255, 255, 0.04));
}

.sidebar-link {
    position: relative;
    overflow: hidden;
}

.sidebar-link::after {
    content: "";
    position: absolute;
    inset: 10px auto 10px 8px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(212, 141, 84, 0), rgba(212, 141, 84, 0.95), rgba(212, 141, 84, 0));
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-link.is-active::after {
    opacity: 1;
    transform: scaleY(1);
}

.sidebar-link-badge {
    box-shadow: 0 10px 24px rgba(185, 114, 49, 0.34);
}

.sidebar-user-card {
    padding: 12px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-header {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 22px 46px rgba(49, 35, 24, 0.08);
}

.header-system-chip,
.header-notification-chip,
.header-user-chip {
    background: rgba(255, 255, 255, 0.84);
}

.header-notification-chip:hover,
.header-user-chip:hover {
    border-color: rgba(181, 126, 69, 0.24);
    box-shadow: 0 12px 24px rgba(49, 35, 24, 0.06);
}

.header-search {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.global-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.global-search-form input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0;
    color: var(--text);
}

.global-search-form input::placeholder {
    color: var(--text-soft);
}

.header-search-submit {
    min-width: 72px;
}

.screen-head {
    padding: 34px 36px;
}

.screen-head h1,
.screen-head h2,
.screen-head h3 {
    letter-spacing: -0.02em;
}

.hero-stat-chip {
    min-width: 168px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 240, 231, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.card,
.section-card,
.summary-card {
    box-shadow:
        0 20px 42px rgba(45, 32, 22, 0.06),
        0 2px 0 rgba(255, 255, 255, 0.5) inset;
}

.premium-kpi-card {
    padding: 28px 22px 24px;
    min-height: 182px;
}

.premium-kpi-card::before {
    content: "";
    position: absolute;
    inset: 20px auto auto 20px;
    width: 40px;
    height: 40px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(181, 126, 69, 0.14) 0%, rgba(181, 126, 69, 0.04) 100%);
    border: 1px solid rgba(181, 126, 69, 0.12);
}

.kpi-label {
    padding-top: 52px;
}

.kpi-value {
    font-size: clamp(34px, 3vw, 46px);
    letter-spacing: -0.04em;
}

.action-strip-card {
    border-radius: 34px;
    box-shadow: 0 28px 52px rgba(45, 32, 22, 0.08);
}

.action-strip-copy {
    max-width: 460px;
}

.action-strip-copy p {
    margin: 0;
}

.action-metric {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.premium-filter-card {
    border-radius: 32px;
}

.premium-filter-toolbar label {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.premium-table-wrap {
    padding: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.premium-data-table {
    border-spacing: 0;
}

.premium-data-table tbody tr.data-row td,
.data-table tbody tr.data-row td {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 244, 236, 0.98) 100%);
    box-shadow: 0 12px 20px rgba(44, 31, 21, 0.04);
}

.premium-data-table tbody tr.data-row:hover td,
.data-table tbody tr.data-row:hover td {
    box-shadow: 0 16px 28px rgba(44, 31, 21, 0.08);
}

.table-primary-link,
.case-name-trigger {
    font-size: 15px;
}

.case-name-trigger:hover,
.case-name-trigger.is-active,
.table-primary-link:hover {
    text-shadow: 0 0 0.01px currentColor;
}

.row-actions {
    gap: 8px;
    flex-wrap: wrap;
}

.quick-card-row.is-open .quick-card-panel {
    max-height: 3200px;
    border-radius: 34px;
    padding: 24px;
}

.quick-card-head {
    align-items: center;
}

.quick-card-section {
    padding: 20px;
    border-radius: 26px;
}

.quick-card-section > h4,
.quick-subsection > h4,
.quick-chat-block > h4 {
    font-size: 24px;
    line-height: 1.1;
}

.quick-chat-item,
.quick-file-link,
.list-item {
    border-radius: 18px;
}

.side-panel {
    border-radius: 30px;
}

.side-panel-head .button.small {
    padding-inline: 12px;
}

.side-stat-item,
.side-link,
.side-notes-list li {
    min-height: 88px;
}

.detail-layout > .stack-gap,
.workspace-main,
.workspace-side {
    gap: 26px;
}

.summary-card strong {
    font-size: 28px;
}

.notification-card.is-unread {
    box-shadow: 0 18px 34px rgba(181, 126, 69, 0.12);
}

.auth-shell {
    gap: 34px;
}

.auth-brand-panel {
    position: relative;
}

.auth-brand-panel::after {
    content: "";
    position: absolute;
    inset: auto 36px 34px auto;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(181, 126, 69, 0.18), transparent 68%);
    pointer-events: none;
}

.premium-auth-card {
    background: rgba(255, 255, 255, 0.92);
}

@media (max-width: 1200px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        flex-basis: auto;
    }
}
