:root{font-family:"Yu Gothic UI","Meiryo",sans-serif;color:#202c3e;background:#fff}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}.login-shell{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.intro{background:#f0f5fc;padding:48px 11%;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;font-size:21px;font-weight:700;text-decoration:none;color:inherit}.brand-icon{display:grid;place-items:center;background:#3266db;color:white;border-radius:11px;width:39px;height:39px;font-size:25px}.intro-copy{margin:auto 0;padding:65px 0}.eyebrow,.section-label{color:#5074ad;font-size:10px;letter-spacing:1.8px;font-weight:700}.intro h1{font-size:clamp(26px,2.7vw,40px);line-height:1.65;letter-spacing:.03em;margin:22px 0}.description{font-size:14px;line-height:2;color:#67768c}.illustration{max-width:360px;margin-top:36px;background:#ffffffdf;border:1px solid white;border-radius:14px;padding:21px 24px;box-shadow:0 18px 45px #365c9510;transform:rotate(-2deg)}.mock-heading{font-size:12px;font-weight:700;padding-bottom:18px;border-bottom:1px solid #edf1f6}.mock-heading span{float:right;color:#a2afc0}.mock-row{display:flex;align-items:center;gap:13px;margin-top:19px}.mock-row b{width:33px;height:33px;border-radius:10px;background:#eaf0ff;color:#7998d9;display:grid;place-items:center;font-size:11px}.mock-row:nth-child(3) b{background:#e7f4ef;color:#73ac98}.mock-row:nth-child(4) b{background:#fff0e5;color:#cfa587}.mock-row div{flex:1}.mock-row i{display:block;height:6px;width:75%;border-radius:4px;background:#e6ecf4}.mock-row i+i{margin-top:7px;width:48%;background:#f0f3f8}.mock-row em{width:36px;height:13px;background:#e8f1ff;border-radius:4px}.intro-footer{font-size:11px;color:#74849a;margin:0}.login-panel{padding:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh}.login-content{width:100%;max-width:360px;margin:auto 0;padding:60px 0}.section-label{color:#8190a5}.login-content h2{font-size:29px;letter-spacing:.08em;margin:13px 0}.subtitle{font-size:13px;color:#778295;margin:0 0 37px}.field{margin-bottom:24px}.field label{display:block;font-size:13px;font-weight:600;margin-bottom:10px}input{width:100%;height:49px;border:1px solid #dbe1e9;border-radius:7px;background:white;padding:0 14px;color:#202c3e;font-size:14px}input::placeholder{color:#9ba5b4;font-size:12px}input:focus{outline:3px solid #376bdb22;border-color:#376bdb}.password-wrap{position:relative}.password-wrap input{padding-right:62px}.password-toggle{position:absolute;right:7px;top:7px;height:35px;padding:0 9px;border:0;background:transparent;color:#5c7090;cursor:pointer;font-size:12px;border-radius:4px}.submit-button{width:100%;height:49px;border:0;border-radius:7px;background:#3266db;color:white;font-weight:600;font-size:14px;cursor:pointer;margin-top:6px;box-shadow:0 4px 8px #3266db18}.submit-button span{float:right;margin-right:9px;font-size:19px;line-height:20px}.submit-button:hover{background:#2555c1}button:focus-visible,a:focus-visible{outline:3px solid #8dabed;outline-offset:4px}.help-text{text-align:center;font-size:12px;color:#7b8797;line-height:1.9;margin-top:27px}.setup-notice{margin:27px 0 0;border-top:1px solid #edf0f5;padding-top:18px;text-align:center;font-size:11px;color:#7c8798}.login-panel footer{color:#929baa;font-size:11px}.field-error{display:block;color:#b13838;font-size:12px;margin-top:7px}.input-validation-error{border-color:#bd4b4b}.form-alert.validation-summary-errors{background:#fff4f1;border:1px solid #f1d4cb;border-radius:7px;color:#9e4030;font-size:12px;padding:12px;margin-bottom:22px;line-height:1.8}.form-alert ul{list-style:none;padding:0;margin:0}@media(max-width:760px){.login-shell{grid-template-columns:1fr}.intro{padding:24px}.intro-copy,.intro-footer{display:none}.brand{font-size:18px}.brand-icon{width:33px;height:33px;font-size:21px}.login-panel{min-height:calc(100dvh - 81px);padding:28px 24px}.login-content{padding:35px 0 45px}.login-content h2{font-size:26px}}
.dashboard{min-height:100vh;background:#f0f5fc;padding:32px max(24px,8vw)}.dashboard-header{display:flex;align-items:center;justify-content:space-between;gap:20px}.logout-button{background:white;border:1px solid #dbe1e9;border-radius:7px;padding:10px 18px;color:#3266db;cursor:pointer}.dashboard-card{background:white;margin-top:48px;border-radius:14px;padding:36px;overflow-wrap:anywhere}.dashboard-card h1{font-size:24px}
.crm-page{min-height:100vh;background:#f4f7fc;padding:28px 36px 48px}.account-menu{display:flex;gap:20px;align-items:center;font-size:13px;color:#637188}.list-heading{margin:38px 0 26px}.list-heading h1{font-size:27px;margin:10px 0}.list-heading>p:last-child{font-size:13px;color:#758297}.clinic-card{background:white;border:1px solid #e1e7f0;border-radius:12px;box-shadow:0 4px 18px #283e6005}.list-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:24px}.clinic-search{max-width:760px;flex:1}.clinic-search label{display:block;font-size:12px;font-weight:600;margin-bottom:9px}.search-controls{display:flex;align-items:center;gap:12px}.search-controls input{min-width:100px;height:44px;background:#fbfcfe}.search-button{border:0;border-radius:7px;background:#3266db;color:white;height:44px;padding:0 24px;white-space:nowrap;cursor:pointer}.clear-search{font-size:12px;color:#627693;white-space:nowrap;text-decoration:none}.column-settings{position:relative;flex-shrink:0;font-size:12px;color:#4d607e}.column-settings summary{cursor:pointer;border:1px solid #dce3ee;padding:12px;border-radius:7px}.column-settings-panel{position:absolute;right:0;top:48px;width:290px;background:white;border:1px solid #dce3ee;border-radius:9px;box-shadow:0 8px 30px #23345620;z-index:5;padding:16px}.column-settings-panel p{font-size:11px}.column-settings ol{padding:0;list-style:none}.column-settings li{display:flex;gap:7px;align-items:center;padding:5px 0}.column-settings li span{flex:1}.column-settings button{background:#f3f6fc;border:1px solid #dce3ee;border-radius:4px;padding:4px 9px;cursor:pointer;color:#455e84}.column-settings button:disabled{opacity:.3;cursor:default}.search-status{font-size:12px;color:#637188;margin:0 24px}.search-status:empty{display:none}.list-meta{padding:18px 24px;display:flex;gap:15px;align-items:center;justify-content:space-between;font-size:11px;color:#7a889c}.list-meta strong{font-size:21px;color:#283b57;font-variant-numeric:tabular-nums}.list-meta strong span{font-size:12px;font-weight:400;color:#7a889c}.table-scroll{overflow:auto;max-height:calc(100vh - 330px);min-height:220px;border-radius:0 0 12px 12px}.table-scroll:focus-visible{outline:3px solid #8dabed;outline-offset:2px}.clinic-table{border-collapse:separate;border-spacing:0;width:100%;min-width:1730px;font-size:12px;text-align:left;table-layout:fixed}.clinic-table th{position:sticky;top:0;z-index:1;background:#f7f9fc;border-top:1px solid #e9edf3;border-bottom:1px solid #e1e7f0;text-align:left;font-weight:600}.clinic-table th a{padding:16px 14px;display:flex;align-items:center;justify-content:space-between;color:#4f627e;text-decoration:none;gap:6px}.clinic-table th a:hover{color:#3266db;background:#eef3ff}.clinic-table th[aria-sort="ascending"] a,.clinic-table th[aria-sort="descending"] a{color:#3266db}.clinic-table td{padding:17px 14px;border-bottom:1px solid #eef1f6;vertical-align:top;line-height:1.8;overflow-wrap:anywhere}.clinic-table tr:last-child td{border-bottom:0}.clinic-table tbody tr:hover{background:#f8faff}.clinic-table [data-column="id"]{width:125px}.clinic-table [data-column="pic"]{width:140px}.clinic-table [data-column="clinic"]{width:255px}.clinic-table [data-column="closed"]{width:120px}.clinic-table [data-column="transactions"]{width:145px}.clinic-table [data-column="address"]{width:260px}.clinic-table [data-column="doctor"]{width:150px}.clinic-table [data-column="products"],.clinic-table [data-column="remarks"]{width:270px}.report-id{color:#73839a;font-variant-numeric:tabular-nums}.clinic-name{font-weight:600;color:#2d4263}.multiline{white-space:pre-wrap}.flag{display:inline-block;font-size:11px;padding:2px 10px;border-radius:5px;white-space:nowrap}.flag-active{color:#24705c;background:#e9f5ef}.flag-closed{color:#a15d56;background:#fbefec}.flag-neutral{color:#6f7b8e;background:#f0f3f7}.empty-clinics{text-align:center;padding:60px 20px;color:#718097;font-size:13px}.empty-clinics p{font-size:12px}.list-error{margin:24px;padding:20px;background:#fff4f1;color:#9e4030;border-radius:7px;font-size:13px}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}@media(max-width:760px){.crm-page{padding:20px 14px}.account-menu{gap:8px}.account-menu>span{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.logout-button{padding:8px 10px;font-size:12px}.list-heading{margin-top:28px}.list-toolbar{padding:18px;flex-wrap:wrap;gap:14px}.clinic-search{flex-basis:100%}.search-controls{gap:8px}.search-button{padding:0 14px}.list-meta{padding:16px 18px;align-items:flex-start;flex-direction:column;gap:7px}.column-settings-panel{left:0;right:auto}.table-scroll{max-height:65vh}.list-heading h1{font-size:24px}}
.detail-page{max-width:none}.back-link{display:inline-block;margin-top:28px;font-size:13px;color:#49678e;text-decoration:none}.back-link:hover{text-decoration:underline}.detail-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin:22px 0 30px}.detail-heading h1{font-size:26px;line-height:1.5;margin:12px 0 0;overflow-wrap:anywhere}.detail-heading nav{display:flex;gap:8px;flex-shrink:0}.detail-heading nav a{font-size:12px;text-decoration:none;color:#46658f;background:white;border:1px solid #dce4ef;border-radius:6px;padding:10px 16px}.detail-heading nav span{margin-left:6px;color:#7b8a9f}.detail-card{background:white;border:1px solid #e1e7f0;border-radius:12px;margin-bottom:26px;scroll-margin-top:20px}.detail-section-heading{display:flex;align-items:center;gap:14px;border-bottom:1px solid #e9eef5;padding:24px 28px}.section-number{font-size:13px;background:#edf3ff;color:#3266db;border-radius:8px;padding:11px}.detail-section-heading h2{font-size:18px;margin:0 0 6px}.detail-section-heading p{font-size:12px;color:#77869a;margin:0;line-height:1.7}.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 28px;padding:28px}.detail-field{min-width:0}.detail-field label{display:block;font-size:12px;font-weight:600;color:#4a5d78;margin-bottom:9px}.detail-field input,.detail-field select,.detail-field textarea{width:100%;border:1px solid #dbe3ed;border-radius:6px;color:#263b57;background:#fff;font:inherit;font-size:14px;padding:11px 13px;line-height:1.6}.detail-field input{height:45px}.detail-field input[readonly]{background:#f5f7fb;color:#74849a}.detail-field textarea{resize:vertical;min-height:90px}.detail-field select:focus,.detail-field textarea:focus{outline:3px solid #376bdb22;border-color:#376bdb}.detail-field small{display:block;color:#8792a2;font-size:11px;margin-top:7px}.field-wide{grid-column:1/-1}.detail-flags{grid-column:1/-1;display:flex;gap:30px;flex-wrap:wrap;padding:16px 18px;background:#f7f9fc;border-radius:7px}.detail-flags label{display:flex;align-items:center;gap:9px;font-size:13px}.detail-flags input{width:17px;height:17px;accent-color:#3266db;margin:0}.detail-flags small{color:#8b96a6;font-size:10px}.order-count{font-size:12px;font-weight:400;color:#8190a5;margin-left:10px}.order-scroll{overflow:auto;max-height:520px;border-radius:0 0 12px 12px}.orders-table{width:100%;min-width:620px;border-spacing:0;text-align:left;font-size:13px}.orders-table th{position:sticky;top:0;background:#f7f9fc;color:#536680;font-size:12px;border-bottom:1px solid #e5ebf3;padding:15px 28px}.orders-table td{padding:18px 28px;border-bottom:1px solid #edf1f6;vertical-align:top;line-height:1.8}.orders-table th:first-child{width:160px}.orders-table .order-price{text-align:right;white-space:nowrap;width:170px;font-variant-numeric:tabular-nums}.orders-table td.multiline{white-space:pre-wrap;overflow-wrap:anywhere}.empty-orders{padding:35px 28px;font-size:13px;color:#7c899b}.bottom-back{margin:0 0 20px}.clinic-detail-link{color:inherit;text-decoration:none}.clinic-detail-link:hover{text-decoration:underline;color:#3266db}.clinic-table tbody tr[data-detail-url]{cursor:pointer}@media(min-width:1500px){.detail-page{padding-left:max(36px,calc((100vw - 1380px)/2));padding-right:max(36px,calc((100vw - 1380px)/2))}}@media(max-width:760px){.detail-heading{display:block}.detail-heading h1{font-size:23px}.detail-heading nav{margin-top:20px}.detail-section-heading{padding:20px}.detail-grid{padding:20px;grid-template-columns:minmax(0,1fr);gap:20px}.detail-flags{gap:18px}.orders-table th,.orders-table td{padding:14px 20px}}
.detail-actions{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:20px 28px;border-top:1px solid #e9eef5;background:#fbfcfe;border-radius:0 0 12px 12px}.detail-actions span{font-size:12px;color:#75849b}.save-success{margin:24px 28px 0;padding:14px 18px;border-radius:6px;background:#e9f5ef;color:#24705c;font-size:13px}.detail-validation.validation-summary-errors{margin:24px 28px 0;padding:12px 18px;background:#fff4f1;color:#9e4030;border-radius:6px;font-size:13px;line-height:1.8}.detail-validation ul{padding-left:18px;margin:0}

/* Shared fixed header and company branding. */
:root { --crm-header-height: 88px; }
.brand-logo { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.brand { white-space: nowrap; }
.dashboard-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--crm-header-height);
    padding: 16px 36px;
    background: #fff;
    border-bottom: 1px solid #e1e7f0;
    box-shadow: 0 2px 12px #283e6008;
}
.crm-page, .dashboard { padding-top: calc(var(--crm-header-height) + 24px); }
.detail-card { scroll-margin-top: calc(var(--crm-header-height) + 20px); }
html { scroll-padding-top: calc(var(--crm-header-height) + 12px); }
@media (max-width: 760px) {
    :root { --crm-header-height: 76px; }
    .dashboard-header { padding: 12px 14px; gap: 12px; }
    .brand-logo { width: 48px; height: 48px; }
    .dashboard-header .brand { font-size: 17px; gap: 8px; }
    .dashboard-header .account-menu > span { max-width: 65px; }
    .crm-page, .dashboard { padding-top: calc(var(--crm-header-height) + 20px); }
    .login-panel { min-height: calc(100dvh - 96px); }
}

/* Keep clinic context visible below the site header while scrolling. */
.detail-heading {
    position: sticky;
    top: var(--crm-header-height);
    z-index: 90;
    background: #f4f7fc;
    padding: 16px 0;
    border-bottom: 1px solid #e1e7f0;
}
.detail-page .detail-card {
    scroll-margin-top: calc(var(--detail-heading-height, 150px) + 16px);
}
@media (min-width: 761px) {
    .detail-field.field-new-row { grid-column-start: 1; }
}
.communications-table{width:100%;min-width:960px;border-spacing:0;text-align:left;font-size:13px;table-layout:fixed}.communications-table th{position:sticky;top:0;background:#f7f9fc;color:#536680;font-size:12px;border-bottom:1px solid #e5ebf3;padding:15px 16px}.communications-table td{padding:16px;border-bottom:1px solid #edf1f6;vertical-align:top;line-height:1.8;overflow-wrap:anywhere}.communications-table th:nth-child(1){width:65px}.communications-table th:nth-child(2){width:125px}.communications-table th:nth-child(3){width:100px}.communications-table th:nth-child(4){width:145px}.communications-table th:nth-child(5){width:90px}.communications-table th:nth-child(6){width:90px}.communications-table .multiline{white-space:pre-wrap}.communications-table .communication-select{width:17px;height:17px;margin:4px 0;accent-color:#3266db;cursor:pointer}.flag-follow-up{background:#fff3da;color:#8b611d}.detail-heading nav{flex-wrap:wrap}@media(max-width:1000px){.detail-heading{flex-wrap:wrap}.detail-heading nav a{padding:9px 12px}}
.communication-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:18px 28px;border-bottom:1px solid #e9eef5}.communication-toolbar form{margin:0}.communication-link{display:inline-flex;align-items:center;text-decoration:none;font-size:13px}.communication-toolbar button:disabled{opacity:.45;cursor:not-allowed}.communication-toolbar .delete-button{color:#b23d3d}.communication-toolbar [role=status]{flex-basis:100%;font-size:12px;color:#637188;overflow-wrap:anywhere;white-space:pre-wrap}.communications-table th:nth-child(1){width:125px}.communications-table th:nth-child(2){width:100px}.communications-table th:nth-child(3){width:145px}.communications-table th:nth-child(4){width:90px}.communications-table th:nth-child(5){width:90px}.communications-table th:nth-child(6){width:auto}.communications-table tbody tr{cursor:pointer}.communications-table tbody tr:hover{background:#f5f8ff}.communications-table tbody tr[aria-selected=true]{background:#e3edff;box-shadow:inset 4px 0 #3266db}.communications-table tbody tr:focus-visible{outline:2px solid #3266db;outline-offset:-2px}.communication-editor{max-width:1200px;margin:auto}.communication-editor .detail-heading{position:static}.communication-editor textarea{min-height:110px}
#communication-delete-dialog{border:1px solid #dce3ee;border-radius:12px;padding:28px;max-width:520px;width:calc(100% - 32px);color:#263b57;box-shadow:0 15px 70px #23345640}#communication-delete-dialog::backdrop{background:#15243a66}#communication-delete-dialog h2{font-size:20px;margin-top:0}#communication-delete-dialog p{font-size:14px;line-height:1.8;overflow-wrap:anywhere;max-height:40vh;overflow:auto}#communication-delete-dialog form{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}#communication-delete-dialog .search-button{background:#b23d3d}
#mail-send:disabled{opacity:.45;cursor:not-allowed}.mail-new{padding:0 28px 20px;font-size:13px}.mail-new a{color:#3266db}

.communication-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.communication-fields:disabled { opacity: .8; }
.communication-recovery { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; color: #64748b; }
.communication-recovery small { overflow-wrap: anywhere; }
.append-outline-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; }
.append-outline-arrow { color: #4a5d78; font-size: 18px; }

.history-sort { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: inherit; white-space: nowrap; }
.history-sort span { font-size: 11px; }
.history-sort:hover, th[aria-sort="ascending"] .history-sort, th[aria-sort="descending"] .history-sort { color: #3266db; }
.history-sort:focus-visible { outline: 2px solid #3266db; outline-offset: 5px; border-radius: 2px; }

.clinic-table td { padding-top: 10px; padding-bottom: 10px; }
.clinic-table tr:last-child td { border-bottom: 1px solid transparent; }
.clinic-cell-content {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    height: 3.6em;
    overflow: hidden;
}
.clinic-table tr[aria-expanded="true"] .clinic-cell-content {
    display: block;
    -webkit-line-clamp: unset;
    height: auto;
    min-height: 3.6em;
    overflow: visible;
}
.clinic-table tr[aria-expanded="true"] { background: #f0f5ff; }
.clinic-table tbody tr:focus-visible { outline: 2px solid #3266db; outline-offset: -2px; }
.clinic-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px 16px; color: #637188; font-size: 12px; }
.clinic-pagination > div { display: flex; align-items: center; gap: 12px; }
.clinic-pagination a { display: inline-block; padding: 7px 11px; color: #3266db; background: #f3f6fc; border: 1px solid #dce3ee; border-radius: 5px; text-decoration: none; }
.clinic-pagination a:hover { background: #eaf0fd; }
.clinic-pagination a:focus-visible { outline: 2px solid #3266db; outline-offset: 2px; }
.daily-report-link { display: inline-block; padding: 10px 18px; border-radius: 7px; background: #3266db; color: white; text-decoration: none; white-space: nowrap; }
.daily-report-link:hover { background: #2454ba; }
.daily-report-date { font-size: 14px; color: #637188; margin: 12px 0 0; }
.daily-report-date span { margin-left: 20px; font-weight: 600; color: #2d4263; }
.daily-report-table { width: 100%; min-width: 700px; border-spacing: 0; table-layout: fixed; text-align: left; font-size: 13px; }
.daily-report-table th { position: sticky; top: 0; background: #f7f9fc; color: #536680; border-bottom: 1px solid #e5ebf3; padding: 15px 20px; }
.daily-report-table td { padding: 16px 20px; border-bottom: 1px solid #edf1f6; line-height: 1.8; vertical-align: top; overflow-wrap: anywhere; }
.daily-report-table th:nth-child(1), .daily-report-table th:nth-child(2) { width: 90px; }
.daily-report-table th:nth-child(3) { width: 30%; }
.daily-report-recipients { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 24px 28px 0; font-size: 12px; color: #637188; overflow-wrap: anywhere; }
.daily-report-note { padding: 0 28px; font-size: 12px; color: #8b611d; }
