/* KALVASS Office | Blue & Gold identity | v0.4.08
 * UI-only layer. Enqueued with media="screen": printed offers retain their
 * existing layout/colors and all commercial content remains unchanged.
 * Scope: TKP Office only. Do not style generic WordPress elements globally.
 */
:root:has(.tkp-app) {
  --tkp-bg: #f3f6fa;
  --tkp-card: #ffffff;
  --tkp-card-2: #f7f9fc;
  --tkp-text: #081c3a;
  --tkp-muted: #61728b;
  --tkp-border: #dbe4ee;
  --tkp-green-soft: #fff2d8;
  --tkp-green-mid: #d9a441;
  --tkp-accent: #d9a441;
  --tkp-accent-dark: #081c3a;
  --tkp-accent-ink: #081c3a;
  --tkp-warn: #9a6200;
  --tkp-danger: #b63743;
  --tkp-shadow: 0 3px 14px rgba(8,28,58,.045);
  --tkp-brand-gold: #d9a441;
  --tkp-brand-gold-hover: #efbe63;
  --tkp-brand-navy: #081c3a;
  --tkp-brand-navy-hover: #16345e;
  --tkp-brand-faint: #eaf0f8;
}

/* Shell, workspace and surface hierarchy */
.tkp-app { color: var(--tkp-text); }
.tkp-shell { max-width: 1600px; grid-template-columns: 258px minmax(0,1fr); }
.tkp-workspace { background: #f3f6fa; }
body:has(.tkp-app) .tkp-main { padding: 30px 36px 60px !important; }
.tkp-page-head h1, .tkp-panel h2, .tkp-card-value { color: var(--tkp-brand-navy); }
.tkp-page-head h1 { font-weight: 760; letter-spacing: -.025em; }
.tkp-page-head .tkp-eyebrow, .tkp-eyebrow { color: #a66e12 !important; }
.tkp-panel, .tkp-card, .tkp-offer-item { background: #fff; border-color: var(--tkp-border); box-shadow: var(--tkp-shadow); }
.tkp-panel { border-radius: 14px; }
.tkp-panel-head { border-color: var(--tkp-border); }
.tkp-empty { background: #f8fafd; }

/* Navigation is the main identity anchor. Gold represents selection, not status. */
.tkp-sidebar {
  background: linear-gradient(180deg, #0b2242 0%, #081c3a 62%, #07172e 100%);
  border-right: 1px solid #1a395f;
  color: #f7faff;
}
.tkp-brand { border-bottom: 1px solid rgba(232,239,250,.17); padding-bottom: 18px; margin-bottom: 10px; }
.tkp-brand strong { color: #fff; font-weight: 730; }
.tkp-brand span { color: #bac9de; }
.tkp-brand-mark {
  width: 43px; height: 43px; flex: 0 0 43px;
  background: #081c3a; overflow: hidden;
  border: 1px solid rgba(217,164,65,.78); border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.07);
}
.tkp-brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tkp-nav { scrollbar-color: #6d7e96 transparent; }
.tkp-nav-group-label { color: #c2d1e5; letter-spacing: .10em; }
.tkp-nav-group + .tkp-nav-group { border-top-color: rgba(231,239,250,.15); }
.tkp-nav a, .tkp-nav-details summary { color: #f3f7fd; }
.tkp-nav a .tkp-nav-icon, .tkp-nav-details summary .tkp-nav-icon { color: #e6ad40; }
.tkp-nav a:hover, .tkp-nav-details summary:hover {
  color: #fff; background: #1b385f;
}
.tkp-nav a.is-active, .tkp-nav a.is-active:hover {
  background: #e9b44f; border-color: #f2c86c;
  color: #081c3a; font-weight: 800;
}
.tkp-nav a.is-active .tkp-nav-icon { color: #081c3a; }
.tkp-nav-details[open] summary { background: #203c60; color: #fff; }
.tkp-nav-details[open] summary .tkp-nav-icon { color: #e9b44f; }
.tkp-nav .tkp-nav-sub a.is-active { background: #e9b44f; color: #081c3a; }
.tkp-nav .tkp-nav-sub a.is-active .tkp-nav-icon { color: #081c3a; }
.tkp-nav a.is-disabled { opacity: .43; }
.tkp-nav a small { color: #bac9de; }
.tkp-side-bottom { border-top-color: rgba(231,239,250,.2); }
.tkp-user { color: #c0cfe2; }
.tkp-user strong { color: #fff; }
.tkp-user a { color: #edbb5a; }
.tkp-user a:hover { color: #ffe0a2; }
.tkp-user-avatar { background: #233e60; color: #f3c56d; }

/* Action controls, links, and selection */
.tkp-btn:not(.tkp-btn-secondary):not(.tkp-btn-danger) { background: #081c3a; border-color: #081c3a; color: #fff !important; }
.tkp-btn:not(.tkp-btn-secondary):not(.tkp-btn-danger):hover { background: #17375f; border-color: #17375f; }
.tkp-btn-secondary {
  background: #fff !important;
  border-color: #b9c9dd !important;
  color: #081c3a !important;
}
.tkp-btn-secondary:hover { background: #eff4fa !important; border-color: #8faaca !important; }
.tkp-btn:focus-visible, .tkp-nav a:focus-visible, .tkp-nav-details summary:focus-visible,
.tkp-link:focus-visible, .tkp-menu-toggle:focus-visible {
  outline: 3px solid #d9a441; outline-offset: 2px;
}
.tkp-link, .tkp-link-button, .tkp-unit-link, .tkp-idea-card h2 a:hover { color: #184b83; }
.tkp-btn-danger { background: #a93845 !important; color: #fff !important; }
.tkp-btn-danger:hover { background: #8f2935 !important; }
.tkp-number, .tkp-position-badge { background: #ffedc6; color: #081c3a; }
.tkp-status { background: #eaf0f8; color: #1b406c; }
.tkp-card::before { background: #d9a441; }
.tkp-card-dot { background: #d9a441; }
.tkp-card-tasks::before, .tkp-card-acquisition::before { background: #6285b1; }
.tkp-card-stale::before, .tkp-card-stale .tkp-card-dot { background: #c87978; }
.tkp-card-wait::before, .tkp-card-wait .tkp-card-dot { background: #d9a441; }
.tkp-card-label { color: #52657e; }
.tkp-card-arrow { background: #ffedc6; color: #081c3a; }
.tkp-dashboard-link-card:hover { border-color: #bdcce1; box-shadow: 0 6px 20px rgba(8,28,58,.10); }
.tkp-dashboard-link-card:focus-visible { outline-color: #d9a441; }

/* Forms, selections, filters */
.tkp-field > span { color: #132d50; }
.tkp-field input, .tkp-field select, .tkp-field textarea, .tkp-column-filter {
  background: #fff; color: #122d51; border-color: #b9c9dd;
}
.tkp-field input:focus, .tkp-field select:focus, .tkp-field textarea:focus,
.tkp-column-filter:focus { border-color: #2f629d !important; outline: 2px solid rgba(68,116,172,.28); outline-offset: 1px; }
.tkp-field input:disabled, .tkp-field textarea:disabled, .tkp-field select:disabled { background: #f2f5f9; color: #5c6b80; }
.tkp-mini-add { background: #ffedc6; border-color: #e6c576; color: #081c3a; }
.tkp-mini-add:hover { background: #fbe2a4; }
.tkp-check input, .tkp-need-option input, .tkp-privacy-check input { accent-color: #173f70; }
.tkp-need-option:hover { background: #f4f8fe; border-color: #a4b9d3; }
.tkp-need-option:has(input:checked) { background: #eaf2fc; border-color: #6a95c8; box-shadow: inset 4px 0 0 #d9a441; }
.tkp-need-create { background: #f4f8fd; border-color: #bfcee1; }
.tkp-need-create > div span, .tkp-postal-lookup { color: #526982; }
.tkp-unit-inline, .tkp-inline-form { background: #f7f9fc; border-color: var(--tkp-border); }
.tkp-offer-item, .tkp-offer-item:first-child { border-color: #cbd8e7; }
.tkp-offer-item-head, .tkp-offer-item.is-collapsed .tkp-offer-item-head { background: #f1f5fa; border-bottom-color: #d5e0ee; }
.tkp-offer-item-toggle { color: #081c3a; }

/* Lists, cards, and data tables */
.tkp-table th, .tkp-lead-table thead th { background: #edf3fa; color: #193b67; }
.tkp-table td { border-bottom-color: #e4eaf2; }
.tkp-table tbody tr:hover { background: #f4f8fd; }
.tkp-table code { background: #edf3fa; color: #193b67; }
.tkp-column-filter { border-color: #b9c9dd !important; }
.tkp-lead-table tbody .tkp-lead-row td,
.tkp-lead-table tbody .tkp-lead-row:nth-child(even) td { background: #fff; border-color: #d9e3ef; }
.tkp-lead-table tbody .tkp-lead-row td:first-child { border-left-color: #7b9dc8; }
.tkp-lead-table tbody .tkp-lead-row:hover td,
.tkp-lead-table tbody .tkp-lead-row:focus-visible td { background: #eef4fb; border-color: #acc4df; box-shadow: 0 3px 12px rgba(8,28,58,.07); }
.tkp-lead-table .tkp-link { color: #174576 !important; }
.tkp-project-row { border-bottom-color: #e2eaf4; }
.tkp-project-row:hover { background: #f4f8fd; }
.tkp-info-panel, .tkp-form-dashboard { border-left-color: #d9a441; }
.tkp-privacy-check { border-color: #d4dfeb; }
.tkp-forms-connection input[readonly] { background: #f3f6fa; }

/* Warnings retain a semantically distinct amber alert treatment. */
.tkp-notice { background: #fff7e9; border-color: #f0d9aa; color: #553d18; border-left: 4px solid #d99b2c; }
.tkp-form-duplicate { background: #fff8eb; border-left-color: #d9a441; }
.tkp-form-duplicate-clear { background: #edf7f0; border-left-color: #5c9773; }

/* Mobile header/navigation; never compromise touch-target sizing. */
.tkp-mobile-bar { background: #081c3a; color: #fff; border-bottom-color: #23436a; }
.tkp-mobile-bar strong { color: #fff; }
.tkp-mobile-bar span { color: #d4deec; }
.tkp-menu-toggle { background: #16345d; border-color: #3e5c80; color: #fff; }
.tkp-mobile-logo { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 6px; object-fit: cover; }
.tkp-sidebar-backdrop { background: rgba(5,18,39,.53); }

/* Offer/PDF preview is intentionally not recolored: business-document output
   is a separate design task; the Office navigation is hidden in print. */
.tkp-print-actions .tkp-btn { min-height: 42px; }

@media (max-width: 1180px) {
  .tkp-shell { grid-template-columns: 216px minmax(0,1fr); }
}
@media (max-width: 820px) {
  .tkp-shell { display: block; }
  .tkp-sidebar { width: 260px; }
  body:has(.tkp-app) .tkp-main { padding: 20px 16px 42px !important; }
}
@media (max-width: 620px) {
  .tkp-brand { margin-bottom: 5px; }
  .tkp-field input, .tkp-field select, .tkp-field textarea { font-size: 16px; }
}

/* 0.4.17 – readable system credentials and explicit Table location mapping. */
.tkp-app .tkp-endpoint-row{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
.tkp-app .tkp-endpoint-title,.tkp-app .tkp-endpoint-tools{grid-column:1/-1}
.tkp-app .tkp-endpoint-title{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.tkp-app .tkp-endpoint-row label{min-width:0}
.tkp-app .tkp-endpoint-row input[type=url],.tkp-app .tkp-endpoint-row input[type=password]{width:100%;min-width:0;max-width:none;min-height:44px;border:1px solid #cbd5e1;border-radius:8px;padding:9px 11px;background:#fff;color:#081c3a}
.tkp-app .tkp-endpoint-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.tkp-app .tkp-endpoint-tools small{flex:1 1 260px;line-height:1.5}
.tkp-app .tkp-product-module-foot{flex-wrap:wrap}
.tkp-app .tkp-table-dialog{width:min(620px,calc(100vw - 30px));max-height:85vh;overflow:auto;border:1px solid #d7e0eb;border-radius:16px;padding:24px;color:#081c3a;background:#fff}
.tkp-app .tkp-table-dialog::backdrop{background:rgba(8,28,58,.5)}
.tkp-app .tkp-table-dialog h2{margin-top:0}
.tkp-app .tkp-table-dialog label{display:block;font-weight:700;margin:16px 0}
.tkp-app .tkp-table-dialog select{width:100%;min-height:44px;margin-top:8px;padding:9px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#081c3a}
.tkp-app .tkp-table-dialog .tkp-table-confirm{font-weight:400;line-height:1.5}
.tkp-app .tkp-table-dialog [hidden]{display:none!important}
@media(max-width:900px){.tkp-app .tkp-endpoint-row{grid-template-columns:1fr}.tkp-app .tkp-endpoint-active{grid-column:auto}}

/* 0.4.21: print monitoring, isolated from offer/print layouts. */
.tkp-app .tkp-pm-card{margin:16px 0;padding:18px;border:1px solid #cbd5e1;border-left:5px solid #64748b;border-radius:12px;background:#fff;color:#081c3a}
.tkp-app .tkp-pm-card.has-alarm,.tkp-app .tkp-pm-card.is-unknown{border-left-color:#b42318}
.tkp-app .tkp-pm-card.has-alarm [data-print-message],.tkp-app .tkp-pm-card.is-unknown [data-print-message]{color:#9c251c;font-weight:700}
.tkp-app .tkp-pm-heading,.tkp-app .tkp-pm-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.tkp-app .tkp-pm-heading h3{margin:0 0 5px}.tkp-app .tkp-pm-heading small,.tkp-app .tkp-pm-help{font-size:12px;color:#475569}
.tkp-app .tkp-pm-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0 18px}
.tkp-app .tkp-pm-facts>div{padding:12px;background:#f1f5f9;border-radius:8px}.tkp-app .tkp-pm-facts strong,.tkp-app .tkp-pm-facts small{display:block;overflow-wrap:anywhere}.tkp-app .tkp-pm-facts small{margin-top:7px;color:#475569}
.tkp-app .tkp-pm-issue{padding:12px;margin:10px 0;background:#fff7ed;border:1px solid #e9ba83;border-radius:8px}
.tkp-app .tkp-pm-toolbar{justify-content:flex-start;margin:12px 0}.tkp-app .tkp-pm-toolbar select,.tkp-app .tkp-pm-toolbar input{max-width:100%;min-height:40px}.tkp-app .tkp-pm-toolbar label{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.tkp-app .tkp-pm-card summary{cursor:pointer;font-weight:700;padding:10px 0}.tkp-app .tkp-pm-scroll{overflow-x:auto}.tkp-app .tkp-pm-scroll table{border-collapse:collapse;width:100%;min-width:550px;font-size:12px}.tkp-app .tkp-pm-scroll th,.tkp-app .tkp-pm-scroll td{padding:10px;text-align:left;border-bottom:1px solid #dbe3ec;vertical-align:top;white-space:normal;overflow-wrap:anywhere}.tkp-app .tkp-pm-scroll th{background:#eef2f7}
@media(max-width:720px){.tkp-app .tkp-pm-facts{grid-template-columns:1fr}.tkp-app .tkp-pm-card{padding:12px}.tkp-app .tkp-pm-toolbar{align-items:stretch}.tkp-app .tkp-pm-toolbar select{width:100%}.tkp-app .tkp-pm-toolbar label{width:100%}}
