:root { color-scheme: light; font-family: Arial, sans-serif; }
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 24px; background: #f3f5fa; color: #172033; }
.panel-card { width: min(100%, 440px); padding: clamp(30px, 5vw, 48px); border: 1px solid #e5e9f0; border-radius: 22px; background: white; box-shadow: 0 22px 70px rgba(28,42,70,.08); }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #2563eb; color: white; font-weight: 800; }
.eyebrow { margin: 30px 0 12px; color: #4c64a1; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(28px, 5vw, 36px); letter-spacing: -.04em; }
.intro { margin: 12px 0 30px; color: #697386; line-height: 1.5; }
form { display: grid; gap: 10px; }
label { font-size: 13px; font-weight: 700; }
input { width: 100%; height: 46px; margin-bottom: 10px; padding: 0 14px; border: 1px solid #cdd5e1; border-radius: 10px; font: inherit; }
input:focus { border-color: #2563eb; outline: 3px solid #dce8ff; }
button { min-height: 47px; border: 0; border-radius: 10px; background: #2563eb; color: white; font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
form button { display: flex; align-items: center; justify-content: space-between; padding: 0 17px; }
.message { margin: 6px 0 0; color: #a22b38; font-size: 13px; }
.account-box { display: grid; gap: 7px; margin-bottom: 25px; padding: 18px; border: 1px solid #e5e9f0; border-radius: 12px; background: #f8f9fc; }
.account-box span, .account-box small { color: #697386; font-size: 12px; }
.account-box strong { font-size: 15px; overflow-wrap: anywhere; }
.secondary-button { width: 100%; background: #e9eef8; color: #243c70; }
.settings-card { width: min(100%, 640px); }
textarea { width: 100%; margin-bottom: 10px; padding: 12px 14px; border: 1px solid #cdd5e1; border-radius: 10px; font: inherit; resize: vertical; }
textarea:focus { border-color: #2563eb; outline: 3px solid #dce8ff; }
.counter { float: right; color: #697386; font-weight: 400; }
.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.color-grid label { display: block; margin-bottom: 8px; }
.color-grid input { padding: 4px; }
.store-link, .back-link { display: block; margin-top: 20px; color: #243c70; font-weight: 700; text-align: center; }
.back-link { margin-top: 14px; font-size: 13px; font-weight: 400; }
.message.success { color: #16704a; }
[hidden] { display: none !important; }
.admin-card { width: min(100%, 980px); }
.table-scroll { overflow-x: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 10px; border-bottom: 1px solid #e5e9f0; text-align: left; }
th { color: #697386; font-size: 12px; }
td a { color: #243c70; font-weight: 700; }
select { width: 100%; height: 46px; margin-bottom: 10px; padding: 0 14px; border: 1px solid #cdd5e1; border-radius: 10px; background: white; font: inherit; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; margin: 0; }
.detail-list dt { color: #697386; }
.detail-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.admin-detail-card { width: min(100%, 600px); }
.owner-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e5e9f0; }
.owner-section h2 { margin: 0 0 12px; font-size: 22px; }
.owner-section h3 { margin: 26px 0 16px; font-size: 17px; }
.owner-section p { overflow-wrap: anywhere; }
.owner-section .secondary-button { margin: 8px 0 18px; }
.products-section { margin-top: 42px; }
.products-section h2, .admin-card h2 { font-size: 22px; }
#available-table button { padding: 0 12px; min-height: 38px; font-size: 12px; white-space: nowrap; }
#available-table input { min-width: 120px; margin: 0; }
.checkbox-label { display: flex; align-items: center; gap: 10px; margin: 6px 0 16px; }
.checkbox-label input { width: 18px; height: 18px; margin: 0; }

/* Drive Maestro admin */
.drive-admin-page { display: block; padding: 20px; background: #f3f5fa; }
.drive-admin-shell { width: min(100%, 1380px); min-height: calc(100vh - 40px); margin: 0 auto; padding: 26px 30px 36px; border: 1px solid #e1e6ef; border-radius: 18px; background: #fff; box-shadow: 0 14px 45px rgba(28,42,70,.06); }
.drive-admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.drive-admin-header .eyebrow { margin-top: 0; }
.drive-admin-header .intro { margin-bottom: 0; }
.drive-admin-back { margin-top: 8px; color: #243c70; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.drive-tabs { display: flex; gap: 4px; margin: 28px 0 24px; padding: 4px; overflow-x: auto; border: 1px solid #dfe5ee; border-radius: 11px; background: #f6f8fb; }
.drive-tabs button { min-height: 38px; padding: 0 16px; border-radius: 8px; background: transparent; color: #556176; font-size: 13px; white-space: nowrap; }
.drive-tabs button[aria-selected="true"] { background: #fff; color: #172033; box-shadow: 0 1px 5px rgba(28,42,70,.1); }
.drive-view { min-width: 0; }
.drive-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.drive-section-heading h2 { margin: 0 0 4px; font-size: 21px; }
.drive-section-heading p { margin: 0; color: #697386; font-size: 13px; }
.drive-scan-control { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.drive-scan-control button { min-width: 148px; min-height: 40px; padding: 0 16px; white-space: nowrap; }
.drive-scan-control button:disabled { background: #8b98ab; cursor: wait; }
.drive-scan-control p { max-width: 390px; color: #556176; text-align: right; }
.drive-scan-control p[data-state="succeeded"] { color: #176443; }
.drive-scan-control p[data-state="partial"] { color: #8a5a08; }
.drive-scan-control p[data-state="failed"] { color: #9a2935; }
.drive-state { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 120px; padding: 22px; border: 1px dashed #ccd4e1; border-radius: 10px; color: #697386; text-align: center; }
.drive-state--error { flex-direction: column; border-color: #e5bbc0; background: #fff8f8; color: #8c2632; }
.drive-state button { min-height: 36px; padding: 0 14px; }
.drive-spinner { width: 18px; height: 18px; border: 2px solid #c7d2e4; border-top-color: #2563eb; border-radius: 50%; animation: drive-spin .75s linear infinite; }
@keyframes drive-spin { to { transform: rotate(360deg); } }
.drive-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #e1e6ef; border-radius: 10px; overflow: hidden; }
.drive-metric { min-width: 0; padding: 15px 17px; border-right: 1px solid #e8ecf2; border-bottom: 1px solid #e8ecf2; }
.drive-metric:nth-child(4n) { border-right: 0; }
.drive-metric:nth-last-child(-n+4) { border-bottom: 0; }
.drive-metric span { display: block; margin-bottom: 4px; color: #697386; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.drive-metric strong { display: block; overflow: hidden; font-size: 20px; text-overflow: ellipsis; }
.drive-scan-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.drive-compact-panel { padding: 17px; border: 1px solid #e1e6ef; border-radius: 10px; background: #fafbfc; }
.drive-compact-panel h3 { margin: 0 0 12px; font-size: 15px; }
.drive-scan-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.drive-scan-facts div { min-width: 0; }
.drive-scan-facts dt { color: #778196; font-size: 11px; }
.drive-scan-facts dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.drive-summary-actions { display: flex; gap: 9px; margin-top: 14px; }
.drive-summary-actions button { min-height: 38px; padding: 0 15px; background: #e9eef8; color: #243c70; font-size: 12px; }
.drive-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: end; gap: 8px; margin-bottom: 12px; }
.drive-search-field span { display: block; margin-bottom: 6px; font-size: 12px; }
.drive-toolbar input, .drive-inline-filters select { height: 40px; margin: 0; }
.drive-toolbar button, .drive-inline-filters button { min-height: 40px; padding: 0 16px; }
.drive-button--quiet { background: #e9eef8; color: #243c70; }
.drive-filter-bar { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.drive-filter-bar button { min-height: 34px; padding: 0 12px; border: 1px solid #d9e0eb; background: #fff; color: #5c677b; font-size: 12px; white-space: nowrap; }
.drive-filter-bar button[aria-pressed="true"] { border-color: #9cb6e9; background: #edf3ff; color: #204b9b; }
.drive-breadcrumbs { display: flex; align-items: center; gap: 5px; min-height: 38px; margin-bottom: 8px; overflow-x: auto; color: #758096; font-size: 12px; }
.drive-breadcrumbs button { min-height: 30px; padding: 0 8px; background: transparent; color: #243c70; font-size: 12px; white-space: nowrap; }
.drive-breadcrumbs button[aria-current="page"] { color: #172033; cursor: default; }
.drive-breadcrumb-separator { color: #a2aaba; }
.drive-table-wrap { width: 100%; overflow: auto; border: 1px solid #e1e6ef; border-radius: 10px; }
.drive-table { min-width: 850px; font-size: 12px; }
.drive-table th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; background: #f7f9fc; white-space: nowrap; }
.drive-table td { max-width: 360px; padding: 10px 12px; vertical-align: middle; }
.drive-resource-cell { display: flex; align-items: center; gap: 10px; min-width: 250px; }
.drive-resource-icon { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 7px; background: #eef2f8; font-size: 16px; }
.drive-resource-copy { min-width: 0; }
.drive-resource-name { display: block; width: 100%; padding: 0; overflow: hidden; border: 0; background: none; color: #1d3767; font-size: 13px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
button.drive-resource-name { min-height: 26px; cursor: pointer; }
.drive-resource-copy small { display: block; margin-top: 2px; overflow: hidden; color: #7a8496; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.drive-status { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; background: #eef1f5; color: #5c6677; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.drive-status--succeeded, .drive-status--active { background: #e9f6ef; color: #176443; }
.drive-status--failed, .drive-status--missing { background: #fcebed; color: #9a2935; }
.drive-status--partial, .drive-status--inaccessible { background: #fff4dd; color: #8a5a08; }
.drive-row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.drive-row-actions button, .drive-row-actions a { min-height: 30px; padding: 6px 9px; border-radius: 7px; background: #e9eef8; color: #243c70; font-size: 11px; font-weight: 700; text-decoration: none; }
.drive-row-actions button { border: 0; }
.drive-more-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 50px; }
.drive-more-row p { margin: 0; color: #697386; font-size: 12px; }
.drive-more-row button { min-height: 34px; padding: 0 15px; }
.drive-inline-filters { display: flex; align-items: end; gap: 10px; margin-bottom: 14px; }
.drive-inline-filters label { min-width: 160px; color: #697386; font-size: 11px; }
.drive-inline-filters select { min-width: 160px; margin-top: 5px; }
.drive-detail-dialog { width: min(94vw, 720px); max-height: 88vh; padding: 0; overflow: auto; border: 0; border-radius: 14px; box-shadow: 0 24px 80px rgba(23,32,51,.24); }
.drive-detail-dialog::backdrop { background: rgba(20,29,44,.46); }
.drive-dialog-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 15px; border-bottom: 1px solid #e5e9f0; background: #fff; }
.drive-dialog-heading .eyebrow { margin: 0 0 7px; }
.drive-dialog-heading h2 { margin: 0; font-size: 21px; overflow-wrap: anywhere; }
.drive-dialog-close { width: 36px; min-height: 36px; padding: 0; background: #eef1f5; color: #39455a; font-size: 22px; }
.drive-detail-dialog > .drive-state, #drive-detail-content { margin: 20px 22px; }
.drive-detail-list { display: grid; grid-template-columns: minmax(130px, auto) minmax(0, 1fr); gap: 10px 18px; margin: 0; }
.drive-detail-list dt { color: #788296; font-size: 12px; }
.drive-detail-list dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.drive-detail-actions { display: flex; gap: 8px; margin-top: 20px; }
.drive-detail-actions a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 8px; background: #2563eb; color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; }

@media (max-width: 760px) {
  .drive-admin-page { padding: 0; }
  .drive-admin-shell { min-height: 100vh; padding: 20px 14px 30px; border: 0; border-radius: 0; box-shadow: none; }
  .drive-admin-header { display: block; }
  .drive-admin-back { display: inline-block; margin-top: 16px; }
  .drive-tabs { margin-top: 20px; }
  .drive-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drive-metric:nth-child(2n) { border-right: 0; }
  .drive-metric:nth-last-child(-n+4) { border-bottom: 1px solid #e8ecf2; }
  .drive-metric:nth-last-child(-n+2) { border-bottom: 0; }
  .drive-scan-summary-grid { grid-template-columns: 1fr; }
  .drive-section-heading { align-items: stretch; flex-direction: column; }
  .drive-scan-control { align-items: stretch; flex-direction: column; }
  .drive-scan-control p { max-width: none; text-align: left; }
  .drive-summary-actions { align-items: stretch; flex-direction: column; }
  .drive-toolbar { grid-template-columns: 1fr 1fr; }
  .drive-search-field { grid-column: 1 / -1; }
  .drive-inline-filters { align-items: stretch; flex-direction: column; }
  .drive-inline-filters label, .drive-inline-filters select { width: 100%; }
  .drive-detail-list { grid-template-columns: 1fr; gap: 3px; }
  .drive-detail-list dd { margin-bottom: 9px; }
}

/* Catalog draft admin */
.catalog-admin-page { display: block; padding: 20px; background: #f3f5fa; }
.catalog-admin-shell { width: min(100%, 1380px); min-height: calc(100vh - 40px); margin: 0 auto; padding: 26px 30px 36px; border: 1px solid #e1e6ef; border-radius: 18px; background: #fff; box-shadow: 0 14px 45px rgba(28,42,70,.06); }
.catalog-admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.catalog-admin-header .eyebrow { margin-top: 0; }
.catalog-admin-header .intro { margin-bottom: 0; overflow-wrap: anywhere; }
.catalog-header-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.catalog-header-actions a { color: #243c70; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.catalog-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto auto; align-items: end; gap: 8px; margin-bottom: 16px; }
.catalog-toolbar label { color: #697386; font-size: 12px; }
.catalog-toolbar input, .catalog-toolbar select { height: 40px; margin: 6px 0 0; }
.catalog-toolbar button { min-height: 40px; padding: 0 16px; }
.catalog-drafts-table { min-width: 1100px; }
.catalog-draft-name { display: block; color: #172033; font-size: 13px; }
.catalog-draft-name + small { display: block; margin-top: 3px; color: #778196; }
.catalog-row-link { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 7px; background: #e9eef8; color: #243c70; font-size: 11px; font-weight: 700; text-decoration: none; }
.drive-status--draft { background: #eef1f5; color: #4d596c; }
.drive-status--in_review { background: #e8f0ff; color: #2854a1; }
.drive-status--rejected { background: #fcebed; color: #9a2935; }
.drive-status--approved, .drive-status--converted { background: #e9f6ef; color: #176443; }
.catalog-detail-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); align-items: start; gap: 16px; }
.catalog-content-column { display: grid; gap: 16px; }
.catalog-panel { padding: 20px; border: 1px solid #e1e6ef; border-radius: 11px; background: #fff; }
.catalog-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.catalog-panel-heading h2 { margin: 0 0 4px; font-size: 18px; }
.catalog-panel-heading p { margin: 0; color: #697386; font-size: 12px; }
.catalog-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.catalog-form label { color: #596579; font-size: 12px; }
.catalog-form input, .catalog-form select, .catalog-form textarea { margin: 6px 0 0; }
.catalog-form textarea { min-height: 76px; resize: vertical; }
.catalog-readonly-status { display: flex; align-items: center; min-height: 40px; margin-top: 6px; padding: 0 13px; border: 1px solid #d8dee8; border-radius: 9px; background: #f3f5f8; color: #465267; font-weight: 700; }
.catalog-form-wide, .catalog-form-actions { grid-column: 1 / -1; }
.catalog-form-actions { display: flex; align-items: center; gap: 14px; }
.catalog-form-actions button { min-height: 40px; padding: 0 17px; }
.catalog-form-actions .catalog-approve-button { background: #176443; }
.catalog-form-actions p { margin: 0; color: #556176; font-size: 12px; }
.catalog-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #e5e9f0; border-radius: 9px; overflow: hidden; }
.catalog-overview-metric { min-width: 0; padding: 12px; border-right: 1px solid #e8ecf2; border-bottom: 1px solid #e8ecf2; }
.catalog-overview-metric:nth-child(3n) { border-right: 0; }
.catalog-overview-metric:nth-last-child(-n+3) { border-bottom: 0; }
.catalog-overview-metric span { display: block; color: #778196; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.catalog-overview-metric strong { display: block; margin-top: 4px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; }
.catalog-content-list { max-height: 390px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.catalog-content-list li { padding: 9px 0; border-bottom: 1px solid #edf0f4; color: #2f3b50; font-size: 12px; overflow-wrap: anywhere; }
.catalog-content-list li:last-child { border-bottom: 0; }
.catalog-content-list .catalog-content-empty { color: #7b8596; }
.master-publication-control { margin-top: 20px; padding-top: 18px; border-top: 1px solid #e5e9f0; }
.master-publication-control p { margin: 0 0 12px; color: #596579; font-size: 12px; line-height: 1.5; }
.master-publication-control button { min-height: 40px; padding: 0 17px; }
.master-publication-control button[data-action="publish"] { background: #176443; }
.master-publication-control button[data-action="unpublish"] { background: #9a2935; }
.master-publication-control #master-publication-message { min-height: 18px; margin: 10px 0 0; color: #9a2935; font-weight: 700; }
.master-distribution .eyebrow { margin: 0 0 5px; }
.master-distribution-options { display: grid; gap: 9px; }
.master-distribution-options label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid #dfe4ec; border-radius: 9px; cursor: pointer; }
.master-distribution-options input { margin-top: 3px; }
.master-distribution-options strong, .master-distribution-options small { display: block; }
.master-distribution-options strong { color: #202b3e; font-size: 13px; }
.master-distribution-options small { margin-top: 3px; color: #697386; line-height: 1.4; }
.master-distribution-subsection { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e5e9f0; }
.master-distribution-subsection > label { display: block; margin-bottom: 6px; color: #596579; font-size: 12px; font-weight: 700; }
.master-distribution-subsection select, .master-distribution-subsection input { width: 100%; min-height: 40px; }
.master-distribution-subsection h3 { margin: 0 0 6px; font-size: 14px; }
.master-distribution-subsection h3:not(:first-child) { margin-top: 18px; }
.master-distribution-subsection > p { margin: 0 0 12px; color: #697386; font-size: 12px; line-height: 1.5; }
.master-distribution-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.master-distribution-actions button { min-height: 40px; padding: 0 17px; }
.master-distribution-actions p { margin: 0; color: #176443; font-size: 12px; font-weight: 700; }
.master-store-list { display: grid; gap: 7px; max-height: 240px; margin: 9px 0 0; padding: 0; overflow: auto; list-style: none; }
.master-store-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; background: #f4f6f9; font-size: 12px; }
.master-store-row span { min-width: 0; overflow-wrap: anywhere; }
.master-store-row button { flex: none; min-height: 32px; padding: 0 10px; font-size: 11px; }
.admin-nav-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e5e9f0; }
.admin-nav-group > span { display: block; margin-bottom: 7px; color: #697386; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.admin-nav-group .store-link { margin-top: 0; }
.admin-nav-group .store-link + .store-link { margin-top: 8px; }

@media (max-width: 900px) {
  .catalog-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .catalog-admin-page { padding: 0; }
  .catalog-admin-shell { min-height: 100vh; padding: 20px 14px 30px; border: 0; border-radius: 0; box-shadow: none; }
  .catalog-admin-header, .catalog-header-actions { align-items: flex-start; flex-direction: column; }
  .catalog-toolbar { grid-template-columns: 1fr 1fr; }
  .catalog-toolbar label { grid-column: 1 / -1; }
  .catalog-form { grid-template-columns: 1fr; }
  .catalog-form-wide, .catalog-form-actions { grid-column: auto; }
  .catalog-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-overview-metric:nth-child(3n) { border-right: 1px solid #e8ecf2; }
  .catalog-overview-metric:nth-child(2n) { border-right: 0; }
  .catalog-overview-metric:nth-last-child(-n+3) { border-bottom: 1px solid #e8ecf2; }
  .catalog-overview-metric:last-child { border-bottom: 0; }
}
