* { box-sizing: border-box; }
html { overflow-x: hidden; }
body { margin: 0; overflow-x: hidden; font-family: Inter, Arial, sans-serif; color: #23302b; background: #f3f4ef; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.owner-login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: linear-gradient(135deg, #10251d 0%, #344238 48%, #eee8db 48%, #f8f5ed 100%); }
.owner-login-shell { width: min(1040px, 100%); display: grid; grid-template-columns: 1fr 420px; gap: 28px; align-items: stretch; }
.owner-login-intro { min-height: 520px; display: flex; flex-direction: column; justify-content: flex-end; padding: 44px; color: #fff; background: #143026; border-radius: 8px; }
.owner-login-intro span, .owner-hero span { color: #d8b35a; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.owner-login-intro h1 { max-width: 560px; margin: 18px 0 14px; font: 500 56px Georgia, serif; line-height: 1; }
.owner-login-intro p { max-width: 520px; color: rgba(255,255,255,.78); line-height: 1.7; }
.owner-login-card { display: grid; align-content: center; padding: 38px; background: #fffdf7; border: 1px solid #e0dbcf; border-radius: 8px; box-shadow: 0 24px 50px rgba(31,44,38,.16); }
.owner-login-card h2 { margin: 0 0 8px; font: 500 30px Georgia, serif; }
.owner-login-card p { margin: 0 0 22px; color: #66736d; line-height: 1.6; }
.owner-login-card form, .owner-report-card form, .premium-actions { display: grid; gap: 12px; }
.owner-login-card button { width: 100%; min-height: 46px; font-size: 13px; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; color: #415049; }
input, select, textarea { width: 100%; border: 1px solid #d8d2c6; border-radius: 6px; padding: 12px; background: #fff; color: #23302b; }
textarea { resize: vertical; }
button, .owner-hero-action, .owner-row-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #1f5b46;
    border-radius: 6px;
    padding: 10px 14px;
    color: #fff;
    background: #1f5b46;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(31,91,70,.12);
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
button:hover, .owner-hero-action:hover, .owner-row-link:hover { background: #174837; border-color: #174837; box-shadow: 0 10px 20px rgba(31,91,70,.18); transform: translateY(-1px); }
button:active, .owner-hero-action:active, .owner-row-link:active { transform: translateY(0); box-shadow: 0 5px 12px rgba(31,91,70,.12); }
button:focus-visible, .owner-hero-action:focus-visible, .owner-row-link:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(216,179,90,.45);
    outline-offset: 2px;
}
button.secondary, .owner-hero-action.secondary { color: #1f5b46; background: #e2eee8; border-color: #c9ddd3; box-shadow: none; }
button.secondary:hover, .owner-hero-action.secondary:hover { color: #fff; background: #1f5b46; border-color: #1f5b46; }
.owner-alert, .owner-notice { padding: 12px 14px; border-radius: 6px; background: #fff0dc; color: #785121; border: 1px solid #e5c58b; }

.owner-page { min-height: 100vh; padding-left: 280px; }
.owner-sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; display: flex; flex-direction: column; gap: 22px; padding: 22px; background: #152820; color: #f7f2e8; }
.owner-brand { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.owner-brand span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 6px; color: #153026; background: #d8b35a; font-weight: 900; }
.owner-sidebar nav { display: grid; gap: 8px; }
.owner-sidebar nav a { padding: 12px; border-radius: 6px; color: rgba(255,255,255,.76); }
.owner-sidebar nav a.active, .owner-sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.owner-admin-card { margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(255,255,255,.06); }
.owner-admin-card strong, .owner-admin-card small { display: block; }
.owner-admin-card small { margin-top: 5px; color: rgba(255,255,255,.64); line-height: 1.5; }
.owner-header { position: sticky; top: 0; z-index: 4; min-height: 68px; display: flex; justify-content: space-between; align-items: center; padding: 0 30px; background: rgba(255,253,247,.92); border-bottom: 1px solid #ded9cc; backdrop-filter: blur(10px); }
.owner-header > div { min-width: 0; display: flex; align-items: center; gap: 12px; }
.compact-page-name { min-width: 0; overflow: hidden; color: #23302b; font-size: 13px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.owner-header .text-button {
    min-height: 36px;
    color: #1f5b46;
    background: #e2eee8;
    border-color: #c9ddd3;
    padding: 8px 12px;
    box-shadow: none;
}
.owner-header .text-button:hover { color: #fff; background: #1f5b46; border-color: #1f5b46; }
.owner-main { padding: 28px 30px 54px; }
.owner-hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding: 34px; border-radius: 8px; background: #fffdf7; border: 1px solid #e1dccf; }
.owner-hero.compact { align-items: center; }
.owner-hero h1 { max-width: 760px; margin: 10px 0 10px; font: 500 42px Georgia, serif; line-height: 1.08; }
.owner-hero p { max-width: 760px; margin: 0; color: #637069; line-height: 1.65; }
.owner-hero strong { padding: 10px 14px; border-radius: 6px; background: #20352b; color: #fff; white-space: nowrap; }
.owner-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.owner-metrics article, .owner-panel, .owner-report-card { border: 1px solid #e1dccf; border-radius: 8px; background: #fffdf7; box-shadow: 0 12px 28px rgba(34,45,39,.04); }
.owner-metrics article { padding: 20px; }
.owner-metrics span { color: #66736d; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.owner-metrics strong { display: block; margin: 10px 0 6px; font: 500 34px Georgia, serif; }
.owner-metrics small { color: #6f7b75; }
.owner-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 16px; margin-top: 16px; }
.owner-panel { padding: 22px; }
.owner-section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.owner-section-title h2 { margin: 0; font: 500 25px Georgia, serif; }
.owner-section-title a, .owner-tabs a { color: #1f5b46; font-size: 12px; font-weight: 900; }
.owner-bars { height: 180px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 8px; align-items: end; }
.owner-bars div { min-width: 0; display: grid; gap: 6px; align-items: end; text-align: center; color: #7b867f; font-size: 10px; }
.owner-bars span { display: block; width: 100%; border-radius: 5px 5px 2px 2px; background: #1f5b46; }
.owner-bars .bar-size-1 { height: 12px; }
.owner-bars .bar-size-2 { height: 24px; }
.owner-bars .bar-size-3 { height: 36px; }
.owner-bars .bar-size-4 { height: 48px; }
.owner-bars .bar-size-5 { height: 60px; }
.owner-bars .bar-size-6 { height: 72px; }
.owner-bars .bar-size-7 { height: 84px; }
.owner-bars .bar-size-8 { height: 96px; }
.owner-bars .bar-size-9 { height: 108px; }
.owner-bars .bar-size-10 { height: 120px; }
.owner-split-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.owner-split-stats div { padding: 14px; border-radius: 6px; background: #edf1ec; }
.owner-split-stats strong { display: block; font-size: 28px; }
.owner-split-stats span { color: #65716b; font-size: 12px; }
.owner-list { display: grid; gap: 10px; }
.owner-list a, .owner-list > div { display: grid; gap: 4px; padding: 12px; border: 1px solid #ece5d8; border-radius: 6px; background: #fff; }
.owner-list span, .owner-list small, .owner-muted { color: #6b7771; font-size: 12px; }
.owner-filter { display: grid; grid-template-columns: minmax(260px, 1fr) 180px 110px; gap: 10px; margin: 16px 0; }
.owner-filter button { min-height: 46px; }
.owner-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.owner-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.owner-table th, .owner-table td { padding: 14px; border-bottom: 1px solid #ebe4d8; text-align: left; vertical-align: top; }
.owner-table th { color: #637069; font-size: 11px; text-transform: uppercase; }
.owner-table td small { display: block; margin-top: 4px; color: #708079; }
.owner-table td form { display: grid; grid-template-columns: 135px 92px; gap: 8px; align-items: center; }
.owner-table td form.owner-admin-access-form { grid-template-columns: 120px 120px 92px; }
.owner-table td button { min-height: 38px; padding: 9px 11px; box-shadow: none; }
.owner-row-link {
    min-height: 34px;
    margin-top: 8px;
    margin-right: 6px;
    padding: 8px 10px;
    color: #1f5b46;
    background: #f6fbf8;
    border-color: #c9ddd3;
    box-shadow: none;
    vertical-align: middle;
}
.owner-row-link:hover { color: #fff; background: #1f5b46; border-color: #1f5b46; }
.owner-status { display: inline-block; padding: 6px 8px; border-radius: 999px; color: #234236; background: #e2eee8; font-size: 11px; font-weight: 900; }
.owner-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.owner-tabs a { padding: 10px 12px; border: 1px solid #dcd5c7; border-radius: 6px; background: #fffdf7; }
.owner-tabs a.active { color: #fff; background: #1f5b46; border-color: #1f5b46; }
.owner-pagination { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.owner-pagination a, .owner-pagination span { min-width: 38px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 11px; border: 1px solid #dcd5c7; border-radius: 6px; background: #fffdf7; color: #1f5b46; font-size: 12px; font-weight: 900; }
.owner-pagination a.active { color: #fff; background: #1f5b46; border-color: #1f5b46; }
.owner-pagination span { color: #728078; background: transparent; border-color: transparent; }
.owner-report-card { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; padding: 20px; }
.owner-report-card h2 { margin: 6px 0; font: 500 24px Georgia, serif; }
.owner-report-card p { color: #5f6d66; line-height: 1.6; }
.owner-report-card small, .owner-report-card span { color: #78847e; font-size: 12px; }
.owner-report-card form button, .premium-actions form button { width: 100%; }
.premium-actions form { padding: 12px; border: 1px solid #ebe4d8; border-radius: 8px; background: #fff; }
.premium-actions { grid-template-columns: 1fr; }
.owner-settings-form { display: grid; gap: 12px; }
.owner-settings-form button { justify-self: start; min-width: 150px; }
.owner-hero-action { min-width: 132px; white-space: nowrap; }
.owner-action-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.owner-detail-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 16px; margin-top: 16px; }
.admin-canvas-panel { background: #ecebe5; }
.editor-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: minmax(245px, auto) minmax(245px, auto) minmax(210px, auto); gap: 8px; }
.editor-block { min-width: 0; padding: 15px; display: flex; flex-direction: column; border: 1px solid rgba(23,35,31,.12); border-radius: 7px; scroll-margin-top: 20px; }
.editor-block > header { display: flex; justify-content: space-between; gap: 8px; color: #17231f; font-size: 9px; font-weight: 950; letter-spacing: .09em; text-transform: uppercase; }
.editor-block > header small { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: rgba(255,255,255,.6); }
.block-prompt { min-height: 34px; margin: 12px 0; color: #17231f; font: 600 14px/1.2 Georgia, serif; }
.tone-yellow { background: #f2c766; }
.tone-blue { background: #9fc8d5; }
.tone-coral { background: #ef765f; }
.tone-mint { background: #a9d8bd; }
.tone-lilac { background: #c5b9d9; }
.block-kp { grid-column: 1 / 3; grid-row: 1 / 3; }
.block-ka { grid-column: 3 / 5; grid-row: 1; }
.block-kr { grid-column: 3 / 5; grid-row: 2; }
.block-vp { grid-column: 5 / 7; grid-row: 1 / 3; }
.block-cr { grid-column: 7 / 9; grid-row: 1; }
.block-ch { grid-column: 7 / 9; grid-row: 2; }
.block-cs { grid-column: 9 / 11; grid-row: 1 / 3; }
.block-cost { grid-column: 1 / 6; grid-row: 3; }
.block-revenue { grid-column: 6 / 11; grid-row: 3; }
.canvas-notes { display: flex; flex-direction: column; gap: 7px; }
.canvas-note { padding: 9px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border-radius: 5px; background: rgba(255,255,255,.76); box-shadow: 0 2px 7px rgba(30,40,35,.08); }
.canvas-note p { width: 100%; margin: 0; overflow-wrap: anywhere; color: #17231f; font-size: 11px; line-height: 1.4; }
.canvas-note small, .note-author { color: #82908a; font-size: 7px; }
.block-empty { margin-top: auto; padding: 9px; border-radius: 5px; color: rgba(23,35,31,.55); background: rgba(255,255,255,.42); font-size: 10px; font-weight: 800; text-align: center; }
.compact-list { max-height: 520px; overflow: auto; padding-right: 4px; }
.owner-ai-list { display: grid; gap: 12px; }
.owner-ai-list article { padding: 16px; border: 1px solid #e7dfd0; border-radius: 8px; background: #fff; }
.owner-ai-list article.assistant { background: #edf1ec; }
.owner-ai-list small { color: #718079; font-size: 11px; font-weight: 800; }
.owner-ai-list p { margin: 8px 0 0; color: #31423a; line-height: 1.65; white-space: normal; }
.owner-ai-list span { display: block; margin-top: 10px; color: #8b3f32; font-size: 12px; }
.owner-ai-scroll-frame { max-height: 520px; overflow: auto; padding-right: 6px; -webkit-overflow-scrolling: touch; }
.owner-feedback-form { display: grid; gap: 12px; margin: 14px 0 16px; padding: 16px; border: 1px solid #ebe4d8; border-radius: 8px; background: #fff; }
.owner-feedback-form textarea { min-height: 132px; }
.owner-feedback-form button { justify-self: end; min-width: 220px; }
.owner-admin-feedback-list { max-height: 360px; overflow: auto; padding-right: 6px; -webkit-overflow-scrolling: touch; }
.owner-admin-feedback-list article { border-color: #c9ddd3; background: #f6fbf8; }
.mobile-dashboard-menu { display: none; position: relative; }
.mobile-dashboard-menu summary {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #c9ddd3;
    border-radius: 6px;
    color: #1f5b46;
    background: #e2eee8;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}
.mobile-dashboard-menu summary::-webkit-details-marker { display: none; }
.mobile-menu-panel { position: absolute; right: 16px; top: 56px; min-width: 230px; display: grid; gap: 6px; padding: 10px; border: 1px solid #ded7c9; border-radius: 8px; background: #fffdf7; box-shadow: 0 18px 36px rgba(34,45,39,.12); }
.mobile-menu-panel a { padding: 10px; border-radius: 6px; color: #23302b; }
.mobile-menu-panel a.active, .mobile-menu-panel a:hover { background: #edf1ec; }

@media (max-width: 1180px) {
    .owner-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .owner-grid, .owner-detail-grid { grid-template-columns: 1fr; }
    .owner-hero h1 { font-size: 38px; }
}

@media (max-width: 980px) {
    .owner-login-shell, .owner-grid, .owner-metrics, .owner-detail-grid { grid-template-columns: 1fr; }
    .owner-login-intro { min-height: 320px; }
    .owner-page { padding-left: 0; }
    .owner-sidebar { display: none; }
    .owner-header { min-height: 62px; gap: 10px; padding: 0 16px; }
    .owner-header form { flex: 0 0 auto; }
    .owner-header .text-button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
    .mobile-dashboard-menu { display: block; }
    .mobile-menu-panel { left: 0; right: auto; top: 46px; width: min(280px, calc(100vw - 32px)); max-height: calc(100vh - 80px); overflow: auto; }
    .owner-main { padding: 18px 16px 40px; }
    .owner-hero, .owner-report-card { grid-template-columns: 1fr; flex-direction: column; align-items: flex-start; }
    .owner-hero { gap: 16px; }
    .owner-hero strong { white-space: normal; }
    .editor-grid { grid-template-columns: 1fr; grid-template-rows: none; }
    .editor-block, .block-kp, .block-ka, .block-kr, .block-vp, .block-cr, .block-ch, .block-cs, .block-cost, .block-revenue { grid-column: 1; grid-row: auto; min-height: 220px; }
    .owner-filter { grid-template-columns: 1fr; }
    .owner-filter button, .owner-action-row, .owner-hero-action, .owner-feedback-form button, .owner-settings-form button { width: 100%; }
    .owner-feedback-form button, .owner-settings-form button { min-width: 0; justify-self: stretch; }
    .owner-table td form { grid-template-columns: 1fr; }
    .owner-table td form.owner-admin-access-form { grid-template-columns: 1fr; }
    .owner-tabs { flex-wrap: nowrap; margin-right: -16px; padding-bottom: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .owner-tabs a { flex: 0 0 auto; }
    .owner-pagination { flex-wrap: nowrap; margin-right: -16px; padding-bottom: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .owner-pagination a, .owner-pagination span { flex: 0 0 auto; }
    .owner-section-title { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
    .owner-login-page { padding: 14px; }
    .owner-login-shell { gap: 14px; }
    .owner-login-intro { min-height: 260px; }
    .owner-login-intro, .owner-login-card, .owner-hero, .owner-panel { padding: 18px; }
    .owner-login-intro h1, .owner-hero h1 { font-size: 31px; }
    .owner-login-card h2 { font-size: 26px; }
    .owner-metrics { grid-template-columns: 1fr; gap: 10px; }
    .owner-metrics article { padding: 16px; }
    .owner-metrics strong { font-size: 30px; }
    .owner-split-stats { grid-template-columns: 1fr; }
    .owner-header { padding: 0 12px; }
    .compact-page-name { max-width: 42vw; font-size: 12px; }
    .owner-header .text-button { max-width: 118px; white-space: normal; }
    .owner-table { min-width: 760px; }
    .owner-table th, .owner-table td { padding: 11px; }
    .owner-report-card { padding: 16px; }
    .owner-bars { height: 150px; gap: 5px; }
    .editor-block, .block-kp, .block-ka, .block-kr, .block-vp, .block-cr, .block-ch, .block-cs, .block-cost, .block-revenue { min-height: 180px; }
    .block-prompt { font-size: 13px; }
    .owner-login-card button,
    .owner-filter button,
    .owner-table td button,
    .owner-report-card form button,
    .premium-actions form button,
    .owner-hero-action,
    .owner-row-link { width: 100%; }
    .owner-row-link { margin-right: 0; }
}
