:root {
    --bg: #edf2f6;
    --bg-accent: #dceef0;
    --surface: #ffffff;
    --surface-alt: #f6f9fc;
    --surface-soft: #f1f6f8;
    --surface-strong: #ecf4f7;
    --text: #142334;
    --muted: #64748b;
    --primary: #165dcc;
    --primary-dark: #1149a1;
    --primary-soft: rgba(22, 93, 204, 0.12);
    --secondary: #e2e8f0;
    --secondary-dark: #cbd5e1;
    --danger: #c2410c;
    --success: #15803d;
    --warning: #ca8a04;
    --info: #1d4ed8;
    --border: #d6e0ea;
    --border-strong: #c2d0dd;
    --shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 26px 54px rgba(15, 23, 42, 0.12);
    --radius: 20px;
    --radius-sm: 14px;
    --content-max: 1480px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: "Segoe UI Variable", "Segoe UI", "Trebuchet MS", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(22, 93, 204, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.12), transparent 24%),
        linear-gradient(180deg, #f5f9fb 0%, var(--bg) 200px);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

img,
video {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
}

.login-body {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-shell {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    background: var(--surface);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.login-panel {
    padding: 2rem;
}

.login-panel-brand {
    background: radial-gradient(circle at top left, rgba(15, 118, 110, 0.92), rgba(7, 89, 133, 0.92));
    color: #fff;
    display: flex;
    align-items: center;
}

.eyebrow,
.role-pill,
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.eyebrow {
    background: rgba(255, 255, 255, 0.18);
    margin-bottom: 1rem;
}

.feature-list {
    padding-left: 1rem;
    margin: 1rem 0 0;
}

.feature-list li {
    margin-bottom: 0.65rem;
}

.app-shell {
    display: flex;
    min-height: 100dvh;
    position: relative;
}

.sidebar {
    width: 280px;
    background:
        linear-gradient(180deg, rgba(12, 27, 62, 0.98), rgba(15, 23, 42, 0.96)),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 35%),
        radial-gradient(circle at bottom right, rgba(250, 204, 21, 0.12), transparent 28%);
    color: #e2e8f0;
    padding: 1.35rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    position: sticky;
    top: 0;
    height: 100dvh;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    padding: 0.5rem 0.35rem 0.95rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #facc15);
    color: #fff;
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
}

.sidebar-nav {
    display: grid;
    gap: 0.45rem;
    align-content: start;
}

.sidebar-section-label {
    color: rgba(191, 219, 254, 0.7);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.2rem 0.85rem 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: #cbd5e1;
    transition: 0.18s ease;
    word-break: break-word;
    border: 1px solid transparent;
    font-weight: 600;
    position: relative;
}

.sidebar-link-indicator {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(191, 219, 254, 0.35);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.02);
    transition: 0.18s ease;
    flex-shrink: 0;
}

.nav-icon,
.menu-toggle svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.sidebar-link-label {
    flex: 1;
    min-width: 0;
}

.sidebar-link.active,
.sidebar-link:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(250, 204, 21, 0.14));
    color: #fff;
    border-color: rgba(147, 197, 253, 0.22);
    transform: translateX(2px);
}

.sidebar-link:hover .sidebar-link-indicator,
.sidebar-link.active .sidebar-link-indicator {
    background: #facc15;
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.16);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.role-pill {
    background: rgba(250, 204, 21, 0.16);
    color: #fde68a;
    width: fit-content;
}

.sidebar-user-card {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user-card small {
    color: #94a3b8;
}

.sidebar-overlay {
    display: none;
}

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

.topbar {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(217, 226, 236, 0.85);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.topbar-title h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.45rem, 2vw, 2rem);
}

.topbar-title {
    flex: 1;
}

.topbar-title .muted {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0;
}

.content-area {
    padding: 1.5rem;
    display: grid;
    gap: 1.5rem;
}

.content-shell {
    width: min(100%, var(--content-max));
    margin: 0 auto;
    display: grid;
    gap: 1.65rem;
}

.content-shell > .page-section,
.content-shell > .grid-two,
.content-shell > .grid-three,
.content-shell > .stats-grid,
.content-shell > .stats-grid-compact,
.content-shell > .dashboard-hero {
    width: 100%;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.45rem;
    border: 1px solid rgba(214, 224, 234, 0.82);
    min-width: 0;
    word-break: break-word;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.nested-card {
    box-shadow: none;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #fbfdff, var(--surface-alt));
}

.form-card {
    display: grid;
    gap: 1.15rem;
}

.client-create-form {
    gap: 1.35rem;
}

.page-section {
    display: grid;
    gap: 1.35rem;
}

.section-heading,
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-heading h2,
.form-header h2 {
    margin-bottom: 0.3rem;
    font-size: clamp(1.2rem, 1.65vw, 1.6rem);
    line-height: 1.2;
}

.section-heading > div:first-child,
.form-header > div:first-child {
    display: grid;
    gap: 0.2rem;
}

.section-heading p,
.form-header p {
    margin-bottom: 0;
}

.section-heading .muted,
.form-header .muted {
    max-width: 72ch;
}

.grid-two,
.grid-three,
.stats-grid,
.stats-grid-compact {
    display: grid;
    gap: 1rem;
}

.grid-two {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-three {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.stats-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card {
    background: linear-gradient(180deg, #ffffff, #f7fbfc);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.15rem 1.15rem 1.05rem;
    box-shadow: var(--shadow-soft);
    min-width: 0;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.5), rgba(14, 165, 233, 0.2));
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.75), transparent 40%);
    pointer-events: none;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.55rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

.stat-card strong {
    font-size: clamp(1.55rem, 2vw, 2.15rem);
    line-height: 1.05;
    word-break: break-word;
    letter-spacing: -0.03em;
}

.stat-card-accent {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(14, 165, 233, 0.08));
}

.stat-card-success {
    background: linear-gradient(135deg, rgba(21, 128, 61, 0.12), rgba(255, 255, 255, 0.9));
}

.stat-card-warning {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.13), rgba(255, 255, 255, 0.92));
}

.stat-card-danger {
    background: linear-gradient(135deg, rgba(194, 65, 12, 0.12), rgba(255, 255, 255, 0.92));
}

.field {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.field span {
    font-weight: 600;
    font-size: 0.95rem;
    color: #213547;
    line-height: 1.35;
}

.field-label-text {
    display: inline;
}

.field-requirement {
    display: inline-flex;
    align-items: center;
    margin-left: 0.45rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    vertical-align: middle;
}

.field-requirement-required {
    background: #dcfce7;
    color: #166534;
}

.field-requirement-optional {
    background: #e2e8f0;
    color: #334155;
}

.field-requirement-conditional {
    background: #fef3c7;
    color: #92400e;
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    background: #fff;
    color: var(--text);
    font-size: 16px;
    min-width: 0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(15, 118, 110, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

.autofilled {
    background: #e0f2fe;
    border-color: rgba(22, 93, 204, 0.28);
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.22);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

input[readonly],
textarea[readonly] {
    background: #f8fafc;
    color: #475569;
}

select[multiple] {
    min-height: 180px;
}

.form-grid,
.filter-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.filter-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.filter-panel {
    padding: 1.05rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff, var(--surface-soft));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

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

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-field input {
    width: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 0;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    transition: 0.16s ease;
    text-align: center;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
    font-size: 0.95rem;
}

.btn-sm {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.26);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px dashed var(--border-strong);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    border-color: rgba(100, 116, 139, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 10px 24px rgba(194, 65, 12, 0.18);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(194, 65, 12, 0.22);
}

.btn:active {
    transform: translateY(0);
}

.btn.is-loading,
.btn:disabled {
    opacity: 0.78;
    cursor: wait;
}

.inline-actions,
.quick-actions,
.sticky-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.inline,
.inline-form {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

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

.sticky-actions {
    position: sticky;
    bottom: 0.75rem;
    justify-content: flex-end;
    background: linear-gradient(180deg, rgba(237, 242, 246, 0.2), rgba(237, 242, 246, 0.96));
    padding-top: 1rem;
    z-index: 12;
    border-top: 1px solid rgba(214, 224, 234, 0.7);
}

.flash-stack {
    display: grid;
    gap: 0.85rem;
}

.alert {
    border-radius: 16px;
    padding: 1rem 1rem 1rem 1.1rem;
    border: 1px solid transparent;
    word-break: break-word;
    box-shadow: var(--shadow-soft);
    line-height: 1.5;
}

.alert-toast {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    width: min(360px, calc(100vw - 2rem));
    z-index: 70;
    transform: translateY(-14px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.alert-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.alert-toast.is-hiding {
    opacity: 0;
    transform: translateY(-10px);
}

.alert-success {
    background: rgba(21, 128, 61, 0.12);
    color: #14532d;
    border-color: rgba(21, 128, 61, 0.18);
}

.alert-error,
.alert-danger {
    background: rgba(194, 65, 12, 0.1);
    color: #9a3412;
    border-color: rgba(194, 65, 12, 0.16);
    border-left: 4px solid rgba(194, 65, 12, 0.45);
}

.alert-info {
    background: rgba(29, 78, 216, 0.08);
    color: #1d4ed8;
    border-color: rgba(29, 78, 216, 0.12);
    border-left: 4px solid rgba(29, 78, 216, 0.35);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.badge-success {
    background: rgba(21, 128, 61, 0.14);
    color: var(--success);
}

.badge-warning {
    background: rgba(180, 83, 9, 0.14);
    color: var(--warning);
}

.badge-danger {
    background: rgba(194, 65, 12, 0.14);
    color: var(--danger);
}

.badge-info {
    background: rgba(29, 78, 216, 0.13);
    color: var(--info);
}

.badge-muted {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    scrollbar-gutter: stable both-edges;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 0.95rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

th {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fbfd;
}

td {
    font-size: 0.95rem;
}

tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.55);
}

tbody tr:hover {
    background: rgba(226, 232, 240, 0.4);
}

.stack-list {
    display: grid;
    gap: 0.8rem;
}

.stack-item {
    display: grid;
    gap: 0.3rem;
    padding: 1rem 1rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, var(--surface-alt));
    word-break: break-word;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.metric-row,
.detail-grid {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    border-bottom: 0;
    padding: 0;
}

.detail-grid > div {
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, var(--surface-alt));
    word-break: break-word;
    min-width: 0;
}

.detail-label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.section-split {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-top: 1rem;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.media-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.media-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff, var(--surface-alt));
    box-shadow: var(--shadow-soft);
}

.media-card-compact {
    min-height: 100%;
}

.media-card img,
.media-card video {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #dbe4ea;
}

.media-card-body {
    padding: 0.85rem;
    display: grid;
    gap: 0.45rem;
}

.media-placeholder {
    height: 180px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #dbeafe, #e2e8f0);
    color: #1e3a8a;
    font-weight: 700;
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
}

.upload-preview .preview-item {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-alt);
}

.upload-preview .preview-item img,
.upload-preview .preview-item video {
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.page-link {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--surface-alt);
    border: 1px solid var(--border);
}

.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.menu-toggle {
    display: none;
}

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

.actions-cell {
    white-space: nowrap;
}

.actions-cell .btn,
.actions-cell .inline-form,
.actions-cell .inline {
    margin: 0.15rem 0.15rem 0.15rem 0;
}

.link-arrow,
.link-danger {
    font-weight: 700;
}

.link-danger {
    color: var(--danger);
}

.tag-cloud,
.chip-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tag {
    background: rgba(22, 93, 204, 0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(22, 93, 204, 0.08);
}

.error-text {
    color: var(--danger);
}

.form-sections,
.section-block {
    display: grid;
    gap: 1rem;
}

.section-block-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.section-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.72rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.job-form .section-block,
.settings-form .section-block {
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fbfd);
    box-shadow: var(--shadow-soft);
}

.section-block h3 {
    margin-bottom: 0.35rem;
    font-size: 1.08rem;
}

.section-block > .muted,
.section-block > p.muted {
    margin-bottom: 0.9rem;
}

.repeat-client-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    border: 1px solid rgba(29, 78, 216, 0.18);
    background: rgba(29, 78, 216, 0.08);
    border-radius: 18px;
    padding: 1rem;
}

.repeat-client-metrics {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.geo-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.geo-actions > .btn {
    flex: 0 0 auto;
}

.geo-actions > input,
.geo-actions > .muted {
    flex: 1 1 220px;
    min-width: 0;
}

.status-action-panel {
    display: grid;
    gap: 0.85rem;
}

.status-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.status-action-grid .btn {
    width: 100%;
}

.materials-list {
    display: grid;
    gap: 0.75rem;
}

.material-row {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(120px, 1fr)) auto;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-alt);
}

.live-map-canvas {
    height: min(56vh, 520px);
    min-height: 320px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.live-map-refresh-note {
    margin-top: 0.75rem;
}

.signature-pad {
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 0.5rem;
    background: #fff;
}

.signature-pad canvas {
    width: 100%;
    height: 220px;
    border-radius: 14px;
    touch-action: none;
    background: #fff;
    display: block;
}

.signature-preview {
    display: grid;
    gap: 0.5rem;
    align-content: start;
}

.signature-preview img {
    max-width: 260px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.signature-preview-large img {
    max-width: 100%;
}

.media-group-section {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.map-actions,
.share-actions {
    display: grid;
    gap: 0.75rem;
}

.share-actions textarea {
    min-height: 200px;
}

.dashboard-hero .card {
    background: linear-gradient(135deg, rgba(22, 93, 204, 0.1), rgba(250, 204, 21, 0.1));
    border: 1px solid rgba(22, 93, 204, 0.12);
    box-shadow: 0 24px 48px rgba(22, 93, 204, 0.08);
}

.dashboard-eyebrow {
    background: rgba(22, 93, 204, 0.1);
    color: var(--primary-dark);
}

.settings-logo-preview img {
    width: 120px;
    max-width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 0.5rem;
}

.settings-preview-card {
    border: 1px dashed var(--border);
    border-radius: 16px;
    padding: 1rem;
    background: var(--surface-alt);
}

.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.empty-state {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
    text-align: center;
    padding: 1.35rem 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, var(--surface-alt));
}

.empty-state strong {
    font-size: 1rem;
}

.empty-state span {
    color: var(--muted);
    max-width: 44ch;
}

.geo-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.geo-confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.geo-confirm-modal__dialog {
    position: relative;
    width: min(640px, 100%);
    max-height: min(88vh, 900px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-hover);
    padding: 1.2rem;
    display: grid;
    gap: 1rem;
}

.geo-confirm-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.geo-confirm-modal__header h3 {
    margin-bottom: 0;
}

.geo-confirm-modal__close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
}

.geo-confirm-modal__body {
    display: grid;
    gap: 0.9rem;
}

.geo-confirm-modal__details strong {
    white-space: pre-wrap;
}

.geo-confirm-modal__actions {
    position: static;
    margin: 0;
    padding: 0;
    background: transparent;
    border-top: 0;
}

.table-empty-row td {
    padding: 1rem;
    border-bottom: 0;
    background: transparent;
}

.card:hover,
.stat-card:hover,
.stack-item:hover,
.media-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.table-wrap:hover {
    box-shadow: var(--shadow-soft);
}

.sidebar {
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.sidebar-section-label {
    padding: 0.55rem 0.85rem 0.35rem;
    margin-top: 0.2rem;
}

.sidebar-link {
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.sidebar-link.active,
.sidebar-link:hover {
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.sidebar-footer {
    gap: 0.9rem;
}

.sidebar-footer-label {
    padding: 0;
    margin-top: -0.15rem;
    color: rgba(191, 219, 254, 0.5);
}

.sidebar-user-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.14), transparent 42%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar {
    padding: 1rem 1.5rem 1.1rem;
    gap: 1.25rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.82)),
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.08), transparent 26%);
}

.topbar-title {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.topbar-welcome {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.topbar-kicker {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.topbar-context-badge,
.topbar-context-company,
.topbar-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.28rem 0.68rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.topbar-context-badge {
    background: rgba(22, 93, 204, 0.1);
    color: var(--primary-dark);
}

.topbar-context-company {
    background: rgba(250, 204, 21, 0.14);
    color: #8a5a00;
}

.topbar-meta {
    align-items: center;
    row-gap: 0.5rem;
}

.topbar-meta-chip {
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    border: 1px solid rgba(214, 224, 234, 0.85);
}

.card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    overflow: hidden;
}

.stat-card strong {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    font-size: clamp(1.8rem, 2.5vw, 2.45rem);
}

.stat-card small {
    display: block;
    margin-top: 0.65rem;
    color: var(--muted);
    max-width: 28ch;
    line-height: 1.45;
}

.stat-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.stat-card-head span:first-child {
    margin-bottom: 0;
}

.stat-card-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary-dark);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 1rem;
    height: 1rem;
}

.btn {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
    white-space: nowrap;
    border-radius: 16px;
    padding: 0.9rem 1.05rem;
    min-height: 46px;
}

.btn-secondary {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    background: linear-gradient(180deg, #ffffff, #eef4f8);
    border-color: rgba(148, 163, 184, 0.2);
}

.btn-ghost {
    box-shadow: none;
}

.btn-danger {
    background: linear-gradient(180deg, #c2410c, #9a3412);
}

.btn.is-loading,
.btn:disabled {
    transform: none;
    box-shadow: none;
}

.btn:focus-visible,
.sidebar-link:focus-visible,
.page-link:focus-visible,
.geo-confirm-modal__close:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
}

.inline,
.inline-form {
    align-items: center;
}

.sticky-actions {
    margin-top: 0.25rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 22px rgba(15, 23, 42, 0.04);
}

.alert {
    position: relative;
}

.alert-success {
    border-left: 4px solid rgba(21, 128, 61, 0.34);
}

.table-wrap {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    border-radius: 20px;
}

tbody tr {
    transition: background 0.16s ease;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(219, 234, 254, 0.42), rgba(254, 249, 195, 0.18));
}

th,
td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.badge {
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.stack-list > .muted {
    margin: 0;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--border-strong);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, var(--surface-alt));
}

.empty-state {
    padding: 1.5rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.media-grid > .empty-state,
.stack-list > .empty-state,
.quick-actions > .empty-state {
    grid-column: 1 / -1;
}

.quick-actions-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
}

.dashboard-action-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(214, 224, 234, 0.94);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.98)),
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.12), transparent 34%);
    box-shadow: var(--shadow-soft);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    min-width: 0;
}

.dashboard-action-card strong {
    font-size: 0.98rem;
}

.dashboard-action-card span {
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.45;
}

.dashboard-action-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--shadow-hover);
}

.dashboard-hero .card {
    padding: 1.6rem;
    background:
        linear-gradient(135deg, rgba(22, 93, 204, 0.12), rgba(250, 204, 21, 0.12)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.7), transparent 34%);
    box-shadow: 0 28px 54px rgba(22, 93, 204, 0.09);
}

.dashboard-hero .inline-actions {
    align-items: stretch;
}

.dashboard-hero .btn {
    min-width: 152px;
}

.dashboard-hero-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.dashboard-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: var(--primary-dark);
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.dashboard-hero-chip svg {
    width: 0.95rem;
    height: 0.95rem;
}

.metric-row {
    align-items: center;
}

.metric-row strong {
    text-align: right;
}

.job-form .section-block,
.settings-form .section-block,
.form-card .section-block {
    padding: 1.25rem;
    gap: 1.1rem;
    border-radius: 22px;
}

.client-create-layout {
    display: grid;
    gap: 1.15rem;
}

.client-create-grid {
    gap: 1rem 1.05rem;
}

.client-create-form .section-block {
    border-color: rgba(214, 224, 234, 0.94);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 253, 0.98)),
        radial-gradient(circle at top right, rgba(22, 93, 204, 0.06), transparent 34%);
    box-shadow: var(--shadow-soft);
}

.client-create-form .section-block-bukku {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 252, 0.98)),
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.12), transparent 36%);
}

.client-create-form .section-block-billing {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 253, 0.98)),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 34%);
}

.job-form .section-block {
    padding: 1.35rem;
    border-color: rgba(214, 224, 234, 0.94);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.98)),
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.08), transparent 36%);
}

.job-form .section-block h3 {
    font-size: 1.12rem;
    margin-bottom: 0.15rem;
}

.job-form .form-grid {
    gap: 1.1rem;
}

.job-form .field span {
    font-weight: 700;
}

.form-grid {
    align-items: start;
}

.lookup-suggestion {
    justify-content: flex-start;
    max-width: 100%;
    white-space: normal;
    text-align: left;
    background: rgba(255, 255, 255, 0.94);
}

[data-client-autofill] {
    overflow: visible;
}

.client-lookup-panel {
    grid-column: 1 / -1;
    display: grid;
    gap: 0.65rem;
    align-self: start;
    position: relative;
    z-index: 4;
}

.client-lookup-suggestions {
    display: grid;
    gap: 0.55rem;
}

.client-lookup-suggestions .lookup-suggestion {
    width: 100%;
    min-height: 46px;
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    justify-content: flex-start;
}

.bukku-picker-actions,
.bukku-picker-results {
    display: grid;
    gap: 0.75rem;
}

.bukku-picker-actions {
    align-items: center;
    grid-template-columns: auto auto minmax(240px, 1fr);
}

.bukku-picker-shell {
    display: grid;
    gap: 0.95rem;
}

.bukku-picker-selection {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(21, 128, 61, 0.16);
    background:
        linear-gradient(180deg, rgba(240, 253, 244, 0.98), rgba(236, 253, 245, 0.96)),
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 42%);
    color: #166534;
    font-weight: 600;
}

.bukku-picker-card {
    display: grid;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    border: 1px solid rgba(214, 224, 234, 0.96);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 253, 0.98)),
        radial-gradient(circle at top right, rgba(22, 93, 204, 0.08), transparent 34%);
    box-shadow: var(--shadow-soft);
}

.bukku-picker-card__header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.bukku-picker-card__title {
    display: grid;
    gap: 0.25rem;
}

.bukku-picker-card__title small {
    color: var(--muted);
}

.bukku-picker-card__badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bukku-picker-card__details {
    display: grid;
    gap: 0.6rem;
}

.bukku-picker-card__line {
    display: grid;
    gap: 0.2rem;
}

.bukku-picker-card__line-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bukku-picker-card__line-value {
    color: var(--text);
    font-size: 0.94rem;
    line-height: 1.5;
    word-break: break-word;
}

.bukku-picker-card__actions {
    display: flex;
    justify-content: flex-end;
}

.bukku-picker-imported__intro {
    display: grid;
    gap: 0.3rem;
}

.bukku-picker-imported__intro .muted {
    margin: 0;
}

.bukku-picker-results {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.bukku-picker-imported {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 20px;
    border: 1px dashed var(--border-strong);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.98)),
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.08), transparent 36%);
}

.bukku-location-import-list {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.bukku-location-import-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.bukku-location-import-card.is-primary {
    border-color: rgba(21, 128, 61, 0.28);
    background:
        linear-gradient(180deg, rgba(240, 253, 244, 0.95), rgba(255, 255, 255, 0.98)),
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.1), transparent 38%);
}

.bukku-location-import-card__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: start;
    flex-wrap: wrap;
}

.bukku-location-import-card__address {
    margin: 0;
    color: var(--text);
    line-height: 1.55;
}

.bukku-location-import-card small,
.bukku-location-import-card__meta {
    color: var(--muted);
    line-height: 1.45;
    word-break: break-word;
}

.bukku-location-import-card__meta {
    font-size: 0.82rem;
    font-weight: 600;
}

.bukku-location-import-card .btn {
    width: 100%;
}

.location-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.95rem;
}

.location-card {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 249, 252, 0.98)),
        radial-gradient(circle at top right, rgba(22, 93, 204, 0.06), transparent 34%);
    box-shadow: var(--shadow-soft);
}

.location-card.is-primary {
    border-color: rgba(21, 128, 61, 0.24);
    background:
        linear-gradient(180deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.98)),
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 40%);
}

.location-card__header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.location-card__address {
    margin: 0;
    line-height: 1.55;
}

.location-card__meta {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.location-card__actions {
    margin-top: 0.2rem;
}

.detail-grid > div,
.location-card,
.bukku-picker-card,
.bukku-location-import-card {
    min-width: 0;
}

.table-wrap thead th {
    background: linear-gradient(180deg, #fbfdff, #f1f6fb);
}

.table-wrap tbody td {
    border-bottom-color: rgba(214, 224, 234, 0.82);
}

[data-client-autofill].is-searching .lookup-suggestion {
    opacity: 0.6;
}

.alert.is-searching::after {
    content: "";
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 999px;
    border: 2px solid rgba(29, 78, 216, 0.18);
    border-top-color: rgba(29, 78, 216, 0.65);
    position: absolute;
    right: 0.95rem;
    top: 50%;
    margin-top: -0.475rem;
    animation: spin 0.8s linear infinite;
}

.geo-confirm-modal__dialog {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.98)),
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.1), transparent 28%);
}

.geo-confirm-modal__header {
    padding-bottom: 0.2rem;
    border-bottom: 1px solid rgba(214, 224, 234, 0.75);
}

.geo-confirm-modal__close {
    transition: color 0.16s ease, transform 0.16s ease;
}

.geo-confirm-modal__close:hover {
    color: var(--text);
    transform: scale(1.05);
}

.geo-confirm-modal__body {
    gap: 1rem;
}

.geo-confirm-modal__details .field-full strong {
    font-size: 1rem;
    color: var(--text);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1100px) {
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        z-index: 30;
        transition: left 0.2s ease;
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 25;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        background: #fff;
        border-radius: 12px;
        padding: 0.65rem 0.9rem;
        min-height: 44px;
    }

    .app-main {
        width: 100%;
    }

    .content-area {
        padding-top: 1rem;
    }
}

@media (max-width: 1280px) {
    .material-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .form-grid,
    .filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

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

@media (max-width: 640px) {
    .content-area,
    .topbar,
    .login-panel {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
        border-radius: 16px;
    }

    .login-shell {
        border-radius: 22px;
    }

    .section-heading,
    .form-header {
        align-items: flex-start;
    }

    .inline-actions,
    .quick-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-actions-dashboard {
        grid-template-columns: 1fr;
    }

    .inline-actions .btn,
    .quick-actions .btn,
    .inline-actions input[type="text"] {
        width: 100%;
    }

    .topbar {
        align-items: flex-start;
    }

    .dashboard-hero-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .alert-toast {
        left: 1rem;
        right: 1rem;
        width: auto;
    }

    .geo-confirm-modal {
        padding: 0.75rem;
    }

    .geo-confirm-modal__dialog {
        border-radius: 18px;
        padding: 1rem;
    }

    .geo-confirm-modal__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .geo-confirm-modal__actions .btn {
        width: 100%;
    }

    .client-lookup-panel {
        gap: 0.5rem;
    }

    .client-lookup-suggestions .lookup-suggestion {
        min-height: 50px;
        padding: 0.9rem 1rem;
    }

    .bukku-picker-actions {
        grid-template-columns: 1fr;
    }

    .bukku-picker-card__header,
    .bukku-location-import-card__header,
    .location-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .bukku-picker-card__actions .btn,
    .bukku-picker-card .btn {
        width: 100%;
    }

    .bukku-location-import-list,
    .location-card-grid {
        grid-template-columns: 1fr;
    }

    .sticky-actions {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 -1rem -1rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--border);
        justify-content: stretch;
        gap: 0.75rem;
    }

    .sticky-actions .btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .media-card img,
    .media-card video,
    .media-placeholder {
        height: 150px;
    }

    .upload-preview {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .metric-row strong {
        text-align: left;
    }

    .repeat-client-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .material-row {
        grid-template-columns: 1fr;
    }

    .geo-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .filter-panel {
        padding: 0.85rem;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.job-mobile-shell {
    gap: 1rem;
}

.job-step-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, var(--surface-alt));
}

.job-toggle-actions {
    gap: 0.75rem;
}

.job-toggle-actions .btn {
    flex: 1 1 180px;
}

.job-summary-strip {
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 250, 0.98));
}

.job-header-compact {
    align-items: flex-start;
    gap: 1rem;
}

.job-title-block {
    min-width: 0;
}

.job-header-actions {
    flex-shrink: 0;
}

.job-cta-card {
    margin-bottom: 1rem;
}

.onedrive-cta {
    width: 100%;
    min-height: 54px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.job-cta-note {
    margin-top: 0.75rem;
}

.job-action-grid {
    gap: 0.75rem;
}

.job-action-grid .btn,
.job-action-grid .inline-form {
    flex: 1 1 180px;
}

.job-action-grid .inline-form .btn {
    width: 100%;
}

@media (max-width: 760px) {
    .responsive-table {
        min-width: 0;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tbody {
        padding: 0.4rem;
    }

    .responsive-table tr {
        margin-bottom: 0.9rem;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: linear-gradient(180deg, #ffffff, var(--surface-alt));
        box-shadow: var(--shadow-soft);
        overflow: hidden;
    }

    .responsive-table tbody tr:nth-child(even),
    .responsive-table tbody tr:hover {
        background: linear-gradient(180deg, #ffffff, var(--surface-alt));
    }

    .responsive-table td {
        border-bottom: 1px solid rgba(214, 224, 234, 0.7);
        padding: 0.8rem 0.9rem;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.3rem;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .responsive-table .actions-cell {
        white-space: normal;
    }

    .job-header-compact,
    .job-toggle-actions,
    .job-action-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .job-header-actions,
    .job-toggle-actions .btn,
    .job-action-grid .btn,
    .job-action-grid .inline-form {
        width: 100%;
    }

    .job-summary-strip {
        padding: 0.8rem 0.9rem;
    }
}

@media (max-width: 560px) {
    .stats-grid,
    .stats-grid-compact {
        grid-template-columns: 1fr;
    }

    .live-map-canvas {
        min-height: 280px;
        height: 48vh;
    }
}

body.sidebar-open {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

@supports (padding: max(0px)) {
    .topbar,
    .content-area,
    .sticky-actions {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .sticky-actions {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

@media print {
    .sidebar,
    .sidebar-overlay,
    .topbar,
    .sticky-actions,
    .inline-actions,
    .quick-actions,
    .btn,
    .menu-toggle {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
