:root {
    --bg: #f6f8fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f9f8f;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #27364d;
    --success: #15803d;
    --danger: #dc2626;
    --warning: #d97706;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 68px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: var(--primary);
}

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #111827;
    color: #fff;
    padding: 18px;
}

.brand {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 22px;
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar a {
    color: #dbe4ee;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
}

.sidebar a.active,
.sidebar a:hover {
    background: #263244;
    color: #fff;
}

.content {
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.topbar h1 {
    margin: 0 0 4px;
    font-size: 28px;
}

.topbar p {
    margin: 0;
    color: var(--muted);
}

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

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.panel,
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric {
    display: grid;
    gap: 6px;
}

.metric span {
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    font-size: 26px;
}

.dashboard-metrics .metric {
    padding-right: 62px;
}

.dashboard-metrics .metric > i {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 7px;
    background: #eff6ff;
    color: var(--primary);
    font-style: normal;
}

.quick-actions-panel h2,
.quick-actions-panel p {
    margin: 0;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.quick-action:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: var(--primary);
}

.dashboard-sections {
    align-items: start;
}

.dashboard-sections .panel {
    min-width: 0;
}

.dashboard-list {
    display: grid;
    margin-top: 10px;
}

.dashboard-list > a {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 11px 5px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}

.dashboard-list > a:hover strong {
    color: var(--primary);
}

.dashboard-list .list-date {
    display: grid;
    place-items: center;
    min-height: 38px;
    border-radius: 6px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.dashboard-list a > span:last-child {
    display: grid;
    min-width: 0;
}

.dashboard-list small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    margin: 0;
    padding: 28px 14px;
    color: var(--muted);
    text-align: center;
}

.sms-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 15px;
}

.sms-summary-grid > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.sms-credit-line,
.cash-status-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.sms-credit-line > strong {
    font-size: 20px;
}

.sms-credit-line .button,
.cash-status-line a {
    margin-left: auto;
}

.cash-status-line a {
    font-weight: 700;
    text-decoration: none;
}

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

.row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid #c9d3df;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    background: #fff;
}

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

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

button:disabled,
button:disabled:hover {
    border-color: #98a2b3;
    background: #98a2b3;
    cursor: not-allowed;
}

.button.ghost {
    background: #fff;
    color: var(--primary);
}

.button.danger {
    border-color: var(--danger);
    background: var(--danger);
}

.link-button {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
}

.link-button:hover {
    background: transparent;
    color: var(--primary-dark);
}

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

.icon-button {
    width: 36px;
    min-height: 36px;
    padding: 0;
}

.primary {
    background: var(--primary);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.table th {
    color: #475467;
    font-size: 13px;
    background: #f8fafc;
}

.right {
    text-align: right !important;
}

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

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.alert.success {
    border-color: #99d6c9;
    color: var(--success);
}

.alert.error {
    border-color: #f4b5b0;
    color: var(--danger);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-card {
    width: min(430px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.sale-items {
    gap: 10px;
}

.sale-item-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.4fr) minmax(220px, 1.6fr) minmax(80px, 0.6fr) minmax(110px, 0.8fr) minmax(120px, 0.8fr) auto;
    gap: 10px;
    align-items: end;
}

.sale-item-row textarea {
    min-height: 40px;
}

.hover-detail {
    position: relative;
}

.hover-card {
    display: none;
    position: fixed;
    z-index: 20;
    top: 50%;
    left: 50%;
    width: min(520px, calc(100vw - 32px));
    max-height: min(60vh, 480px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(17, 24, 39, 0.18);
    padding: 12px;
    pointer-events: none;
    text-align: left;
    transform: translate(-50%, -50%);
}

.hover-detail:hover .hover-card {
    display: block;
}

.ticket {
    width: min(920px, 100%);
    margin: 24px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.ticket-header,
.ticket-pnr,
.ticket-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.ticket-header {
    border-bottom: 2px solid var(--text);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.ticket-pnr {
    display: grid;
    text-align: right;
}

.ticket-meta div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.ticket-meta span,
.ticket-pnr span {
    color: var(--muted);
    font-size: 13px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-day {
    min-height: 110px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.calendar-event {
    display: block;
    margin-top: 6px;
    padding: 6px;
    border-radius: 6px;
    background: #eef6ff;
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
}

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

.sales-summary div {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 14px;
}

.sales-summary span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.sales-summary strong {
    font-size: 24px;
}

.payment-summary label { margin: 0; }
.payment-summary input { margin-top: 6px; }
.change-amount { color: var(--success) !important; }
.remaining-balance { color: var(--danger) !important; }
.account-payment-detail { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--text-secondary); font-size: .9rem; }
.sms-counter { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 12px; border: 1px solid var(--border); background: var(--background); }

.customer-preview {
    border: 1px solid #b7d7ff;
    background: #eef6ff;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.contact-person-control { position: relative; min-width: 0; }
.contact-person-control > label { margin: 0; }
.contact-person-results {
    position: absolute;
    z-index: 30;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}
.contact-person-option {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
}
.contact-person-option:hover, .contact-person-option:focus-visible { background: #eaf2ff; }
.contact-person-option strong, .contact-person-option span { display: block; }
.contact-person-option span { margin-top: 2px; color: var(--text-secondary); font-size: .82rem; }
.contact-person-message { margin: 6px 0 0; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.55);
}

.modal {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.22);
    padding: 18px;
}

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

.modal-header h2 {
    margin: 0;
}

.print-only {
    display: none;
}

.check-label {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

.check-label input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    margin: 0;
}

.section-heading {
    justify-content: space-between;
    align-items: center;
}

.section-heading h2,
.section-heading h3,
.template-list-item p {
    margin: 0;
}

.compact-actions {
    gap: 8px;
    align-items: center;
}

.compact-actions form {
    margin: 0;
}

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

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

.flight-directions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.flight-directions-grid.one-way { grid-template-columns: minmax(0, 1fr); }
.flight-direction-column {
    min-width: 0;
    padding: 14px;
    border: 1px solid;
    border-radius: 8px;
}
.flight-direction-column > .section-heading { min-height: 44px; }
.flight-direction-onward { border-color: #7dd3fc; background: #f0f9ff; }
.flight-direction-onward > .section-heading { color: #075985; }
.flight-direction-return { border-color: #86efac; background: #f0fdf4; }
.flight-direction-return > .section-heading { color: #166534; }
.flight-segment-onward { border-color: #bae6fd; background: #fff; box-shadow: inset 4px 0 0 #0ea5e9; }
.flight-segment-return { border-color: #bbf7d0; background: #fff; box-shadow: inset 4px 0 0 #22c55e; }
.flight-direction-onward input,
.flight-direction-onward select { border-color: #93c5fd; background: #fafdff; }
.flight-direction-return input,
.flight-direction-return select { border-color: #86efac; background: #fbfffc; }

.booking-summary-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 2px solid #7dd3fc;
    border-radius: 8px;
    background: #eaf8ff;
}
.booking-summary-panel .section-heading h2 { margin: 0; color: #0c4a6e; }
.booking-summary-panel .section-heading p { margin: 4px 0 0; color: #475569; }
.booking-summary-panel .itinerary-summary > div { border-color: #bae6fd; background: #fff; }
.booking-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.booking-preview > section {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.booking-preview h3 { margin: 0 0 10px; font-size: 15px; }
.preview-list { display: grid; gap: 8px; }
.booking-preview-item {
    padding: 9px 10px;
    border-left: 3px solid var(--primary);
    background: #f0f9ff;
}
.booking-preview-item strong, .booking-preview-item span { display: block; }
.booking-preview-item span { margin-top: 3px; color: var(--text-secondary); font-size: .86rem; }
.booking-preview-empty { margin: 0; color: var(--text-secondary); font-size: .9rem; }

.template-banner-preview { grid-column: 1 / -1; }
.template-banner-preview img { display: block; width: 100%; max-width: 760px; height: auto; border: 1px solid var(--border); }

.flight-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}
.calendar-weekday { padding: 7px; color: var(--text-secondary); font-size: .78rem; font-weight: 700; text-align: center; }
.flight-calendar .calendar-day { min-width: 0; }
.calendar-day-empty { background: var(--background); border-style: dashed; }
.calendar-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.flight-calendar .calendar-event span, .flight-calendar .calendar-event small { display: block; }
.flight-calendar .calendar-event small { margin-top: 2px; color: var(--text-secondary); }

.itinerary-document-frame {
    display: block;
    width: min(980px, 100%);
    min-height: 1120px;
    margin: 16px auto 0;
    border: 1px solid var(--line);
    background: #fff;
}

.delivery-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid #b7d7ff;
    border-radius: 999px;
    background: #eef6ff;
    color: #124c9e;
    font-size: 12px;
    font-weight: 700;
}

.template-builder-layout {
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    align-items: start;
}

.template-list {
    position: sticky;
    top: 16px;
}

.template-list-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.template-list-item.active {
    border-left: 3px solid var(--primary);
    padding-left: 10px;
}

details {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

details summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 700;
    background: #f8fafc;
}

.details-content {
    padding: 14px;
}

.template-logo-preview {
    width: 90px;
    height: 70px;
    object-fit: contain;
    border: 1px solid var(--line);
}

.template-section-order {
    display: grid;
    gap: 7px;
}

.template-section-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.template-section-row.dragging {
    opacity: .45;
}

.drag-handle {
    cursor: grab;
    color: var(--muted);
    font-size: 20px;
}

/* Modern application shell */
.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.ui-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-shell {
    display: block;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 0;
    overflow: visible;
    background: var(--sidebar-bg);
    color: #f8fafc;
    border-right: 1px solid rgba(255, 255, 255, .06);
    transition: width .22s ease, transform .22s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: var(--topbar-height);
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    overflow: hidden;
}

.brand-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}

.brand-copy {
    display: grid;
    min-width: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.brand-copy strong {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.brand-copy span {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 11px;
}

.sidebar-nav {
    display: flex !important;
    flex: 1;
    flex-direction: column;
    gap: 4px !important;
    padding: 14px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.nav-item,
.nav-group summary {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 42px;
    padding: 9px 11px !important;
    border: 0;
    border-radius: 8px !important;
    color: #cbd5e1 !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease;
}

.nav-item:hover,
.nav-group summary:hover {
    color: #fff !important;
    background: var(--sidebar-hover) !important;
}

.nav-item.active {
    color: #fff !important;
    background: var(--sidebar-active) !important;
    box-shadow: inset 3px 0 0 #60a5fa;
}

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-group {
    border: 0;
    background: transparent;
}

.nav-group summary {
    list-style: none;
    color: #dbeafe !important;
    background: rgba(30, 64, 175, .24);
    border: 1px solid rgba(96, 165, 250, .18);
}

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

.nav-group.active-group > summary {
    color: #fff !important;
    background: #1d4ed8 !important;
    border-color: #60a5fa;
}

.nav-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform .16s ease;
}

.nav-group[open] .nav-chevron {
    transform: rotate(90deg);
}

.nav-children {
    display: grid;
    gap: 3px;
    margin: 3px 0 5px 18px;
    padding-left: 10px;
    border-left: 1px solid #334155;
}

.nav-children .nav-item {
    min-height: 38px;
    font-size: 12px;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: #111b30;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 6px 10px;
    overflow: hidden;
}

.sidebar-user .nav-label {
    display: grid;
    line-height: 1.25;
}

.sidebar-user small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 11px;
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 800;
}

.main-shell {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left .22s ease;
}

.app-topbar {
    position: sticky;
    z-index: 35;
    top: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    height: var(--topbar-height);
    padding: 0 26px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.topbar-icon {
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: #475569;
}

.topbar-icon:hover {
    border-color: #dbe3ee;
    background: #f1f5f9;
    color: var(--primary);
}

.topbar-context {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.topbar-context span {
    color: var(--muted);
    font-size: 11px;
}

.topbar-context strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.profile-menu {
    position: relative;
    margin-left: auto;
    border: 0;
    background: transparent;
}

.profile-menu summary {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 190px;
    padding: 6px 8px;
    border-radius: 8px;
    list-style: none;
    cursor: pointer;
}

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

.profile-menu summary:hover {
    background: #f1f5f9;
}

.profile-menu summary > .ui-icon {
    width: 15px;
    height: 15px;
    margin-left: auto;
}

.profile-copy {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.profile-copy strong,
.profile-copy small {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy small {
    color: var(--muted);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 230px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.profile-dropdown > div {
    display: grid;
    padding: 8px 10px 11px;
    border-bottom: 1px solid var(--line);
}

.profile-dropdown span {
    color: var(--muted);
    font-size: 12px;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 5px;
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--danger);
    text-decoration: none;
    font-weight: 700;
}

.profile-dropdown a:hover {
    background: #fef2f2;
}

.content {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 24px 28px 40px;
}

.page-header {
    margin-bottom: 22px;
}

.breadcrumbs {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.breadcrumbs strong {
    color: var(--primary);
}

.page-header h1 {
    margin: 0;
    font-size: 27px;
    line-height: 1.25;
    letter-spacing: 0;
}

.page-header p {
    max-width: 760px;
    margin: 7px 0 0;
    color: var(--muted);
}

.page-header-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.page-header-main > div {
    min-width: 0;
}

.page-primary-action {
    flex: 0 0 auto;
    gap: 8px;
}

.sidebar-overlay {
    display: none;
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .main-shell {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-chevron {
    display: none;
}

.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 10px;
}

.sidebar-collapsed .nav-item,
.sidebar-collapsed .nav-group summary {
    justify-content: center;
    padding-inline: 8px !important;
}

.sidebar-collapsed .nav-children {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
}

.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding-inline: 0;
}

.sidebar-collapsed [data-tooltip]:hover::after {
    position: absolute;
    z-index: 80;
    left: 58px;
    top: 50%;
    width: max-content;
    max-width: 220px;
    padding: 6px 9px;
    transform: translateY(-50%);
    border-radius: 6px;
    background: #020617;
    color: #fff;
    box-shadow: var(--shadow-md);
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

/* Shared component treatment */
.panel,
.card {
    border-color: var(--line);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.panel > h2:first-child,
.panel > h3:first-child {
    margin-top: 0;
}

h2 {
    font-size: 18px;
    line-height: 1.35;
    letter-spacing: 0;
}

h3 {
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0;
}

.metric {
    position: relative;
    min-height: 112px;
    align-content: center;
    overflow: hidden;
}

.metric::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--primary);
    content: "";
}

.metric span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.metric strong {
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: 0;
}

label {
    color: #334155;
    font-size: 13px;
    font-weight: 650;
}

input,
select,
textarea {
    min-height: 42px;
    border-color: #cbd5e1;
    border-radius: 7px;
    padding: 9px 11px;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}

input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
    background: #f1f5f9;
    color: #64748b;
}

button,
.button {
    min-height: 40px;
    border-radius: 7px;
    padding: 8px 14px;
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

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

.button.ghost {
    border-color: #cbd5e1;
    color: #334155;
}

.button.ghost:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: var(--primary);
}

.link-button {
    box-shadow: none;
}

.table-scroll,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.table-scroll .table,
.table-responsive .table {
    border: 0;
}

.table {
    min-width: 680px;
}

.table th,
.table td {
    padding: 12px 13px;
}

.table th {
    position: relative;
    color: #475569;
    background: #f8fafc;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.table tbody tr {
    transition: background-color .14s ease;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.table td .row {
    align-items: center;
}

.empty-table-cell {
    padding: 34px 18px !important;
    color: var(--muted);
    text-align: center !important;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 10px;
}

.table-search {
    width: min(320px, 100%);
}

.table-search input {
    min-height: 38px;
    padding-left: 12px;
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.table-pagination .button {
    min-height: 34px;
    padding: 5px 10px;
}

.sortable-column {
    padding-right: 25px !important;
    cursor: pointer;
    user-select: none;
}

.sortable-column::after {
    position: absolute;
    right: 9px;
    color: #94a3b8;
    content: "\2195";
    font-size: 12px;
}

.sortable-column[aria-sort="ascending"]::after {
    content: "\2191";
    color: var(--primary);
}

.sortable-column[aria-sort="descending"]::after {
    content: "\2193";
    color: var(--primary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.status-paid,
.status-confirmed,
.status-sent,
.status-active,
.status-delivered {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.status-partially-paid,
.status-pending,
.status-queued {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.status-unpaid,
.status-failed,
.status-cancelled,
.status-inactive {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.status-draft,
.status-skipped {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #475569;
}

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

.alert {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.alert.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.alert.error {
    border-color: #fecaca;
    background: #fef2f2;
}

.toast-stack {
    position: fixed;
    z-index: 90;
    top: 82px;
    right: 20px;
    display: grid;
    gap: 9px;
    width: min(390px, calc(100vw - 32px));
}

.toast {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    box-shadow: var(--shadow-md);
}

.toast button {
    width: 26px;
    min-height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    color: currentColor;
    box-shadow: none;
    font-size: 20px;
}

.toast button:hover {
    background: rgba(15, 23, 42, .06);
    transform: none;
}

.status-chip {
    border-radius: 999px;
}

.calendar-day {
    border-radius: 7px;
    box-shadow: var(--shadow-sm);
}

.calendar-event {
    border-radius: 5px;
}

.modal {
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.auth-page {
    background: #eef2f7;
}

.auth-card {
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

@media (max-width: 1100px) {
    .grid.cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        box-shadow: 18px 0 50px rgba(15, 23, 42, .28);
    }

    .main-shell,
    .sidebar-collapsed .main-shell {
        margin-left: 0;
    }

    .sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
    }

    .sidebar-collapsed .brand-copy,
    .sidebar-collapsed .nav-label,
    .sidebar-collapsed .nav-chevron {
        display: initial;
    }

    .sidebar-collapsed .nav-item,
    .sidebar-collapsed .nav-group summary {
        justify-content: flex-start;
        padding-inline: 11px !important;
    }

    .sidebar-collapsed .sidebar-brand,
    .sidebar-collapsed .sidebar-user {
        justify-content: flex-start;
    }

    .sidebar-collapsed .nav-children {
        margin-left: 18px;
        padding-left: 10px;
        border-left: 1px solid #334155;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 45;
        inset: 0;
        width: 100%;
        min-height: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: rgba(15, 23, 42, .48);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .sidebar-open .sidebar-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .app-topbar {
        padding: 0 18px;
    }

    .grid.cols-2,
    .grid.cols-3,
    .sale-item-row,
    .sales-summary,
    .template-builder-layout {
        grid-template-columns: 1fr;
    }

    .template-list {
        position: static;
    }

    .flight-directions-grid,
    .booking-preview {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 20px 18px 34px;
    }

    .profile-copy {
        display: none;
    }

    .profile-menu summary {
        min-width: 0;
    }

    .sidebar-collapsed [data-tooltip]:hover::after {
        display: none;
    }
}

@media (max-width: 600px) {
    .grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .app-topbar {
        padding: 0 12px;
    }

    .topbar-context span {
        display: none;
    }

    .content {
        padding: 18px 12px 30px;
    }

    .page-header h1 {
        font-size: 23px;
    }

    .page-header-main {
        align-items: stretch;
        flex-direction: column;
        gap: 13px;
    }

    .page-primary-action {
        align-self: flex-start;
    }

    .panel,
    .card {
        padding: 16px;
    }

    .row {
        gap: 9px;
    }

    .row > button,
    .row > .button {
        max-width: 100%;
    }

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

    .flight-calendar {
        grid-template-columns: repeat(7, minmax(92px, 1fr));
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .toast-stack {
        top: 76px;
        right: 12px;
    }

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

    .sms-summary-grid {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .table-search {
        width: 100%;
    }

    .table-pagination {
        justify-content: space-between;
    }
}

.email-template-preview {
    overflow-x: auto;
    padding: 20px;
    border: 1px solid var(--border);
    background: #f8fafc;
}

.email-template-preview > h3 {
    max-width: 720px;
    margin: 0 auto 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 18px;
}

.email-template-preview > div {
    margin: 0 auto;
    background: #fff;
}

.company-logo-setting {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    background: #f8fafc;
}

.company-logo-setting > img {
    width: 96px;
    height: 96px;
    border: 1px solid var(--border);
    background: #fff;
    object-fit: contain;
}

.receipt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(860px, 100%);
    margin: 0 auto 14px;
}

.receipt-toolbar > div:first-child {
    display: grid;
    gap: 2px;
}

.acknowledgement-receipt {
    width: min(860px, 100%);
    margin: 0 auto;
    padding: 32px;
    border: 1px solid var(--border);
    background: #fff;
    color: #111827;
    box-shadow: var(--shadow-sm);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.4;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.acknowledgement-receipt,
.acknowledgement-receipt * {
    color: #000 !important;
}

.receipt-company-header {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 2px solid #000;
}

.receipt-company-header img {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.receipt-company-header h1,
.receipt-title h2,
.receipt-items h3 {
    margin: 0;
    letter-spacing: 0;
}

.receipt-company-header h1 {
    color: #000;
    font-size: 22px;
}

.receipt-company-header p,
.receipt-title p {
    margin: 3px 0;
    color: #000;
}

.receipt-document-id {
    min-width: 170px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    background: transparent;
    text-align: right;
}

.receipt-document-id span,
.receipt-document-id strong,
.receipt-document-id em {
    display: block;
}

.receipt-document-id span {
    color: #000;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.receipt-document-id strong {
    margin: 2px 0 7px;
    color: #000;
    font-size: 18px;
}

.receipt-document-id em {
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}

.receipt-title {
    margin: 20px 0 16px;
    padding: 12px 16px;
    border-top: 1px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
    background: transparent;
    text-align: center;
}

.receipt-title h2 {
    color: #000;
    font-size: 20px;
}

.receipt-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #d1d5db;
    border-left: 1px solid #d1d5db;
}

.receipt-meta-grid > div {
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
}

.receipt-meta-grid strong {
    display: block;
    margin-top: 2px;
    font-size: 13px;
}

.receipt-meta-grid span,
.receipt-meta-grid small {
    display: block;
    color: #000;
    font-size: 11px;
}

.receipt-status.paid,
.receipt-status.partial { color: #000; }

.receipt-items {
    margin-top: 22px;
}

.receipt-items h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

.receipt-items table {
    width: 100%;
    border-collapse: collapse;
}

.receipt-items tbody tr:nth-child(even) {
    background: transparent;
}

.receipt-items th,
.receipt-items td {
    padding: 9px;
    border: 1px solid #d1d5db;
    text-align: left;
}

.receipt-items th {
    background: transparent;
    color: #000;
    font-size: 11px;
    text-transform: uppercase;
}

.receipt-payment-summary {
    width: min(390px, 100%);
    margin: 18px 0 0 auto;
    border: 1px solid #d1d5db;
}

.receipt-payment-summary h3 {
    margin: 0;
    padding: 9px 10px;
    border-bottom: 1px solid #d1d5db;
    background: transparent;
    color: #000;
    font-size: 12px;
    text-transform: uppercase;
}

.receipt-payment-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 7px 10px;
    border-bottom: 1px solid #e5e7eb;
}

.receipt-payment-summary span,
.receipt-payment-summary strong {
    white-space: nowrap;
}

.receipt-payment-summary > div:last-child { border-bottom: 0; }
.receipt-total { background: transparent; }
.receipt-change,
.receipt-balance { color: #000; }
.receipt-acknowledged { background: transparent; color: #000; font-size: 15px; border-top: 2px solid #000; border-bottom: 2px solid #000 !important; }

.receipt-declaration,
.receipt-notes {
    margin: 22px 0 0;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-left: 3px solid #000;
    background: transparent;
}

.receipt-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px;
    margin-top: 64px;
    text-align: center;
}

.receipt-signatures span {
    display: block;
    border-top: 1px solid #111827;
}

.receipt-signatures strong,
.receipt-signatures small {
    display: block;
    margin-top: 5px;
}

.receipt-signatures small { color: #6b7280; }

.acknowledgement-receipt footer {
    margin-top: 28px;
    padding-top: 10px;
    border-top: 1px solid #d1d5db;
    color: #000;
    text-align: center;
    font-size: 11px;
}

@media (max-width: 640px) {
    .company-logo-setting { grid-template-columns: 1fr; }
    .company-logo-setting > img { width: 80px; height: 80px; }
    .receipt-toolbar { align-items: stretch; flex-direction: column; }
    .acknowledgement-receipt { padding: 20px 14px; }
    .receipt-company-header { grid-template-columns: 58px minmax(0, 1fr); align-items: flex-start; }
    .receipt-document-id { grid-column: 1 / -1; width: 100%; text-align: left; }
    .receipt-company-header img { width: 58px; height: 58px; }
    .receipt-company-header h1 { font-size: 17px; }
    .receipt-meta-grid { grid-template-columns: 1fr; }
    .receipt-items { overflow-x: auto; }
    .receipt-items table { min-width: 620px; }
    .receipt-signatures { gap: 28px; }
}

.ai-config-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

.panel-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.panel-heading-row h2,
.panel-heading-row p { margin-top: 0; }

.instruction-upload {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 14px;
    padding: 16px;
    border: 1px dashed var(--border, #cbd5e1);
    border-radius: 8px;
    background: #f8fafc;
}

.instruction-upload small { grid-column: 1 / -1; }

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.detail-list dt { color: #64748b; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.detail-list dd { margin: 0; color: #0f172a; font-weight: 700; overflow-wrap: anywhere; }

.notice-box {
    margin-top: 18px;
    padding: 14px;
    border-left: 3px solid #dc2626;
    background: #f8fafc;
    color: #334155;
}

.notice-box p { margin: 6px 0 0; font-size: 13px; line-height: 1.55; }

.ai-assistant-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.ai-prompt-panel {
    position: sticky;
    top: 94px;
}

.ai-quick-prompt {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 9px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    text-align: left;
    font-weight: 700;
}

.ai-quick-prompt:hover,
.ai-quick-prompt:focus-visible {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.ai-quick-prompt .ui-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.full-width { width: 100%; justify-content: center; margin-top: 16px; }

.ai-chat-panel { padding: 0; overflow: hidden; }
.ai-chat-heading { padding: 20px 22px; border-bottom: 1px solid #e2e8f0; }
.ai-chat-heading form { margin: 0; }

.ai-chat-thread {
    min-height: 390px;
    max-height: 58vh;
    overflow-y: auto;
    padding: 22px;
    background: #f8fafc;
}

.ai-empty-state {
    display: flex;
    min-height: 340px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-align: center;
}

.ai-empty-state .ui-icon { width: 36px; height: 36px; margin-bottom: 10px; color: #2563eb; }
.ai-empty-state h3 { margin: 0 0 7px; color: #0f172a; }
.ai-empty-state p { max-width: 520px; margin: 0; }

.ai-message {
    position: relative;
    width: min(82%, 780px);
    margin-bottom: 18px;
    padding: 15px 17px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .05);
}

.ai-message.user {
    margin-left: auto;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.ai-message-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ai-message-label .ui-icon { width: 15px; height: 15px; }
.ai-message-content { color: #172033; line-height: 1.65; overflow-wrap: anywhere; }

.ai-copy-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 7px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.ai-copy-button:hover { border-color: #2563eb; color: #1d4ed8; }
.ai-copy-button.copied { border-color: #16a34a; color: #15803d; }
.ai-copy-button .ui-icon { width: 14px; height: 14px; }

.ai-composer {
    padding: 18px 22px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.ai-composer textarea { min-height: 118px; resize: vertical; }
.ai-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; }
.ai-composer-footer button { flex: 0 0 auto; }

@media (max-width: 1000px) {
    .ai-config-layout,
    .ai-assistant-layout { grid-template-columns: 1fr; }
    .ai-prompt-panel { position: static; }
    .ai-prompt-panel .notice-box { display: none; }
}

@media (max-width: 640px) {
    .instruction-upload { grid-template-columns: 1fr; }
    .instruction-upload small { grid-column: auto; }
    .panel-heading-row,
    .ai-composer-footer { align-items: stretch; flex-direction: column; }
    .ai-chat-heading { padding: 16px; }
    .ai-chat-thread { max-height: none; min-height: 320px; padding: 14px; }
    .ai-message { width: 94%; }
    .ai-composer { padding: 15px; }
    .ai-composer-footer button { width: 100%; justify-content: center; }
}

@media print {
    @page { size: A4 portrait; margin: 12mm; }

    html,
    body,
    .app-shell,
    .main-shell,
    .content {
        min-height: 0 !important;
        background: #fff !important;
    }

    .sidebar,
    .sidebar-overlay,
    .app-topbar,
    .page-header,
    .toast-stack,
    .topbar,
    .no-print,
    .button,
    button {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .main-shell {
        margin-left: 0 !important;
    }

    .content {
        padding: 0;
    }

    .panel {
        border: 0;
        padding: 0;
    }

    .acknowledgement-receipt {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        font-size: 11px;
    }

    .receipt-company-header { grid-template-columns: 76px minmax(0, 1fr) 155px; gap: 14px; }
    .receipt-company-header img { width: 72px; height: 72px; }
    .receipt-document-id { min-width: 155px; padding: 9px 10px; }
    .receipt-title { margin-top: 14px; padding: 9px 12px; }
    .receipt-title h2 { font-size: 17px; }
    .receipt-items { margin-top: 16px; }
    .receipt-items th, .receipt-items td { padding: 6px 7px; }
    .receipt-payment-summary { margin-top: 14px; }
    .receipt-declaration, .receipt-notes { margin-top: 16px; padding: 9px 10px; }
    .receipt-signatures { margin-top: 48px; }
    .acknowledgement-receipt footer { margin-top: 20px; }

    .ticket {
        border: 0;
        margin: 0;
        width: 100%;
    }

    .print-only {
        display: block;
    }

    .table tbody tr {
        display: table-row !important;
    }
}
