/* Companies directory: filter sidebar, Grid/List toolbar and company cards */
.cd-layout { display: grid; grid-template-columns: 290px 1fr; gap: 28px; align-items: start; }

/* Sidebar */
.cd-filters { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px 20px; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; box-shadow: 0 2px 12px rgba(44,62,80,0.05); }
/* The site sets overflow-x:hidden on html+body, which breaks position:sticky; clip does not. */
html body { overflow-x: clip; }
.cd-filters-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.cd-filters-head h3 { margin: 0; font-size: 1.25rem; font-weight: 800; color: #0f2a4a; }
.cd-clear { font-size: 0.8rem; color: #0f2a4a; text-decoration: none; font-weight: 600; }
.cd-clear:hover { text-decoration: underline; }
.cd-group { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid #eef2f7; }
.cd-group:last-of-type { border-bottom: 0; }
.cd-group-title { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; font-weight: 700; color: #0f2a4a; margin-bottom: 12px; }
.cd-group-title i { width: 18px; text-align: center; color: #0f2a4a; }
.cd-select { width: 100%; padding: 11px 36px 11px 14px; margin-bottom: 10px; border: 1.5px solid #e2e8f0; border-radius: 10px; background: #f8fafc; color: #475569; font-size: 0.84rem; font-family: inherit; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.cd-select:last-child { margin-bottom: 0; }
.cd-select:focus { outline: none; border-color: #0f2a4a; }
.cd-check { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.86rem; color: #475569; cursor: pointer; }
.cd-check:last-child { margin-bottom: 0; }
.cd-check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: 0 0 18px; border: 1.5px solid #cbd5e1; border-radius: 5px; background: #fff; cursor: pointer; display: grid; place-content: center; }
.cd-check input:checked { background: #0f2a4a; border-color: #0f2a4a; }
.cd-check input:checked::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.6rem; color: #fff; }
.cd-apply { width: 100%; margin-top: 6px; padding: 13px; border: 0; border-radius: 10px; background: #0f2a4a; color: #fff; font-size: 0.92rem; font-weight: 700; font-family: inherit; cursor: pointer; transition: background 0.2s; }
.cd-apply:hover { background: #163a63; }

/* Toolbar */
.cd-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.cd-count { font-size: 0.9rem; color: #475569; }
.cd-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cd-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.cd-toggle button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 0; border-radius: 9px; background: transparent; color: #0f2a4a; font-size: 0.84rem; font-weight: 700; font-family: inherit; cursor: pointer; }
.cd-toggle button.is-active { background: #0f2a4a; color: #fff; }
.cd-sort { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-size: 0.84rem; color: #475569; }
.cd-sort select { border: 0; background: transparent; padding: 11px 4px; font-size: 0.84rem; font-weight: 600; color: #0f2a4a; font-family: inherit; cursor: pointer; }
.cd-sort select:focus { outline: none; }

/* Grid + larger cards (2 per row) */
.cd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.cd-grid .cd-cover { height: 180px; }
.cd-grid .cd-logo { flex: 0 0 88px; width: 88px; height: 88px; margin-top: -36px; }
.cd-grid .cd-body { padding: 0 22px 22px; }
.cd-grid .cd-name { font-size: 1.12rem; }
.cd-grid .cd-line { margin-top: 5px; font-size: 0.84rem; }
.cd-grid .cd-desc { margin: 14px 0 12px; font-size: 0.9rem; line-height: 1.55; }
.cd-grid .cd-tag { padding: 5px 13px; font-size: 0.78rem; }
.cd-grid .cd-vac { font-size: 0.88rem; }
.cd-grid .cd-btn { padding: 11px 12px; font-size: 0.86rem; }

/* List view */
.cd-grid.is-list { grid-template-columns: 1fr; }
.cd-grid.is-list .cd-card { flex-direction: row; }
.cd-grid.is-list .cd-cover { flex: 0 0 260px; height: auto; min-height: 230px; }
.cd-grid.is-list .cd-body { padding: 18px 20px; }
.cd-grid.is-list .cd-logo { margin-top: 0; }
.cd-grid.is-list .cd-id { padding-top: 2px; }
.cd-grid.is-list .cd-foot { padding-top: 6px; }
.cd-grid.is-list .cd-btn { flex: 0 0 auto; padding: 9px 26px; }

/* Dark mode */
[data-theme="dark"] .cd-filters, [data-theme="dark"] .cd-card, [data-theme="dark"] .cd-toggle, [data-theme="dark"] .cd-sort { background: #1a2030; border-color: #2a3340; }
[data-theme="dark"] .cd-filters-head h3, [data-theme="dark"] .cd-group-title, [data-theme="dark"] .cd-group-title i, [data-theme="dark"] .cd-clear,
[data-theme="dark"] .cd-name, [data-theme="dark"] .cd-vac, [data-theme="dark"] .cd-sort select, [data-theme="dark"] .cd-toggle button { color: #e2e8f0; }
[data-theme="dark"] .cd-toggle button.is-active { background: #e2e8f0; color: #1a2030; }
[data-theme="dark"] .cd-select { background-color: #232c3d; border-color: #2a3340; color: #cbd5e1; }
[data-theme="dark"] .cd-check, [data-theme="dark"] .cd-count, [data-theme="dark"] .cd-line, [data-theme="dark"] .cd-desc { color: #94a3b8; }
[data-theme="dark"] .cd-tag { background: #263043; color: #cbd5e1; }
[data-theme="dark"] .cd-btn { background: transparent; border-color: #64748b; color: #e2e8f0; }
[data-theme="dark"] .cd-btn:hover { background: #e2e8f0; color: #1a2030; }
[data-theme="dark"] .cd-group, [data-theme="dark"] .cd-filters-head { border-color: #2a3340; }
[data-theme="dark"] .cd-logo { border-color: #1a2030; }

@media (max-width: 1000px) { .cd-layout { grid-template-columns: 1fr; } .cd-filters { position: static; } }
@media (max-width: 640px)  { .cd-grid { grid-template-columns: 1fr; } .cd-grid.is-list .cd-card { flex-direction: column; } .cd-grid.is-list .cd-cover { flex: none; height: 130px; min-height: 0; } .cd-toolbar { align-items: flex-start; } }
