/* Diernus Portal — shared styles (sidebar dashboard) */
:root {
  --bone:        #EDEAE3;
  --bone-2:      #E4E0D6;
  --bone-3:      #D8D2C4;
  --graphite:    #23211C;
  --graphite-60: rgba(35,33,28,.6);
  --graphite-35: rgba(35,33,28,.35);
  --graphite-15: rgba(35,33,28,.15);
  --graphite-08: rgba(35,33,28,.08);
  --cobalt:      #2C49C7;
  --cobalt-15:   rgba(44,73,199,.15);
  --cobalt-soft: rgba(44,73,199,.08);
  --stamp:       #B3232E;
  --amber:       #C2873A;
  --display:     "Archivo", system-ui, -apple-system, sans-serif;
  --body:        "Newsreader", Georgia, serif;
  --mono:        "IBM Plex Mono", "Courier New", monospace;
  --sidebar-w:   248px;
  --topbar-h:    56px;
  --pad:         clamp(1.25rem, 4vw, 4rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bone);
  color: var(--graphite);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: var(--cobalt); color: var(--bone); }
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }

/* ==========================================================================
   LAYOUT — sidebar + top bar
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--graphite);
  color: var(--bone);
  display: flex; flex-direction: column;
  padding: 1.25rem 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: .55rem;
  padding: 0 1.4rem 1.4rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: .14em;
  color: var(--bone);
}
.sidebar .brand b { color: var(--cobalt); background: var(--bone); padding: 0 .4rem; border-radius: 3px; }

.sidebar nav { padding: 1rem 0; flex: 1; }
.sidebar .nav-group { padding: 0 1rem; margin-bottom: 1.4rem; }
.sidebar .nav-label {
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(237,234,227,.4);
  padding: 0 .4rem;
  margin-bottom: .35rem;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .7rem;
  border-radius: 5px;
  color: var(--bone);
  font-family: var(--body);
  font-size: .95rem;
  text-decoration: none;
  transition: background .15s ease;
  position: relative;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar .nav-item.is-active { background: rgba(44,73,199,.18); color: #fff; }
.sidebar .nav-item.is-active::before {
  content: ''; position: absolute; left: -1rem; top: .25rem; bottom: .25rem;
  width: 2px; background: var(--cobalt); border-radius: 2px;
}
.sidebar .nav-item .badge {
  margin-left: auto; font-family: var(--mono); font-size: .62rem;
  background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 8px;
  min-width: 18px; text-align: center;
}
.sidebar .nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .75; }

.sidebar .user-block {
  padding: 1rem 1.4rem; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .7rem;
}
.sidebar .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cobalt); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .8rem; font-weight: 600;
  flex-shrink: 0;
}
.sidebar .user-meta { flex: 1; min-width: 0; }
.sidebar .user-name { font-size: .9rem; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-role { font-family: var(--mono); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(237,234,227,.5); }
.sidebar .logout {
  background: none; border: 1px solid rgba(255,255,255,.1);
  color: rgba(237,234,227,.7); cursor: pointer;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .14em;
  text-transform: uppercase;
  padding: .4rem .55rem; border-radius: 4px;
  display: flex; align-items: center; gap: .35rem;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar .logout:hover { color: var(--stamp); border-color: var(--stamp); background: rgba(179,35,46,.08); }
.sidebar .logout .icon { width: 13px; height: 13px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  height: var(--topbar-h);
  padding: 0 1.6rem;
  background: var(--bone);
  border-bottom: 1px solid var(--graphite-15);
}
.topbar .crumbs { display: flex; align-items: center; gap: .4rem; color: var(--graphite-60); font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.topbar .crumbs .sep { opacity: .4; }
.topbar .crumbs .current { color: var(--graphite); }
.topbar .spacer { flex: 1; }
.topbar .env-pill { font-family: var(--mono); font-size: .6rem; padding: 2px 8px; border: 1px solid var(--graphite-15); border-radius: 999px; color: var(--graphite-60); }
.topbar .user-chip { display: flex; align-items: center; gap: .55rem; font-family: var(--mono); font-size: .72rem; color: var(--graphite-60); }

.content {
  padding: 1.6rem 1.6rem 4rem;
  max-width: 100%;
  min-height: calc(100vh - var(--topbar-h));
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
.eyebrow {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cobalt);
  display: block;
  margin-bottom: .35rem;
}
h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 70, "wght" 800;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1;
  margin: 0 0 .4rem 0;
}
h2 {
  font-family: var(--display);
  font-variation-settings: "wdth" 60, "wght" 700;
  font-size: 1.1rem;
  margin: 0 0 .5rem;
}
.page-head {
  display: flex; align-items: flex-end; gap: 1rem;
  margin-bottom: 1.4rem; flex-wrap: wrap;
}
.page-head > div { flex: 1; min-width: 0; }
.page-head p.lede { color: var(--graphite-60); font-style: italic; font-size: .95rem; max-width: 48em; }
.page-head .actions { display: flex; gap: .55rem; flex-wrap: wrap; }

/* ==========================================================================
   BUTTONS, INPUTS, ETC
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; padding: .55rem 1rem;
  border-radius: 6px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn.primary { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.btn.primary:hover { background: #1F38A6; border-color: #1F38A6; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--graphite); border-color: var(--graphite-35); }
.btn.ghost:hover { border-color: var(--graphite); text-decoration: none; }
.btn.danger { background: transparent; color: var(--stamp); border-color: rgba(179,35,46,.3); }
.btn.danger:hover { background: var(--stamp); color: #fff; text-decoration: none; }
.btn.sm { padding: .35rem .7rem; font-size: .62rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { display: block; margin-bottom: 1rem; }
.field label { display: block; font-family: var(--mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .35rem; color: var(--graphite-60); }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--body); font-size: .95rem;
  padding: .55rem .7rem; background: #fff; color: var(--graphite);
  border: 1px solid var(--graphite-35); border-radius: 4px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cobalt); }

.error   { background: rgba(179,35,46,.08);  border: 1px solid rgba(179,35,46,.3);  color: var(--stamp); padding: .7rem .9rem; border-radius: 4px; margin-bottom: 1rem; font-size: .9rem; }
.success { background: rgba(44,73,199,.08);  border: 1px solid rgba(44,73,199,.3);  color: var(--cobalt); padding: .7rem .9rem; border-radius: 4px; margin-bottom: 1rem; font-size: .9rem; }
.warn    { background: rgba(194,135,58,.08); border: 1px solid rgba(194,135,58,.3); color: var(--amber); padding: .7rem .9rem; border-radius: 4px; margin-bottom: 1rem; font-size: .9rem; }

/* ==========================================================================
   TABLES (for clients, projects, invites lists)
   ========================================================================== */
.table {
  width: 100%; border-collapse: collapse;
  background: #fff; border: 1px solid var(--graphite-15); border-radius: 6px;
  overflow: hidden;
}
.table th, .table td { padding: .8rem 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--graphite-08); }
.table th { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite-60); background: var(--bone-2); font-weight: 500; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--bone); }
.table .name { font-weight: 500; }
.table .name small { color: var(--graphite-60); display: block; font-weight: 400; font-size: .8rem; }
.table .actions { text-align: right; white-space: nowrap; }
.table .row-actions { display: inline-flex; gap: .35rem; }

.status-pill {
  display: inline-block; font-family: var(--mono); font-size: .6rem;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.status-pill.active    { background: rgba(44,73,199,.12);  color: var(--cobalt); }
.status-pill.pending   { background: rgba(194,135,58,.15); color: var(--amber); }
.status-pill.suspended { background: rgba(179,35,46,.12);  color: var(--stamp); }
.status-pill.online    { background: rgba(34,140,76,.15);  color: #1e8e3e; }

/* Role-change select on the Equipa page. Looks like a status-pill until
   you click it, then it behaves like a normal <select>. Only shown to
   admins on rows that aren't their own. */
.role-select{
  display:inline-block;appearance:none;-webkit-appearance:none;
  background:var(--bone);border:1px solid var(--graphite-25);border-radius:999px;
  color:var(--graphite);font-size:.72rem;font-weight:500;
  letter-spacing:.06em;padding:.25rem 1.6rem .25rem .7rem;
  cursor:pointer;line-height:1.1;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 5l3 3 3-3' fill='none' stroke='%23232920' stroke-width='1.4'/></svg>");
  background-repeat:no-repeat;background-position:right .45rem center;background-size:.7rem;
}
.role-select:hover{border-color:var(--cobalt);color:var(--cobalt)}
.role-select:disabled{opacity:.5;cursor:wait}

.empty {
  padding: 3.5rem 1.5rem; text-align: center; color: var(--graphite-60);
  background: var(--bone-2); border: 1px dashed var(--graphite-35); border-radius: 8px;
  position: relative; overflow: hidden;
}
.empty::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 180px; height: 180px;
  background:
    radial-gradient(circle, var(--graphite-08) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.empty > * { position: relative; z-index: 1; }
.empty-title {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 700;
  font-size: 1.05rem; color: var(--graphite); margin-bottom: .35rem;
  font-style: normal; text-transform: none; letter-spacing: -.005em;
}
.empty-sub { font-size: .9rem; font-style: italic; max-width: 36em; margin: 0 auto; }
.empty-cta { margin-top: 1.1rem; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--graphite-15); border-top-color: var(--cobalt); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   STAT CARDS (for overview page)
   ========================================================================== */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.4rem;
}
.stat {
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 6px; padding: 1.1rem 1.2rem;
}
.stat .label { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite-60); }
.stat .value { font-family: var(--display); font-variation-settings: "wdth" 60, "wght" 800; font-size: 2rem; line-height: 1; margin-top: .35rem; }
.stat .delta { font-family: var(--mono); font-size: .7rem; color: var(--graphite-60); margin-top: .35rem; }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-back { position: fixed; inset: 0; background: rgba(35,33,28,.55); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-back.on { display: flex; }
.modal { background: var(--bone); border-radius: 8px; padding: 1.8rem; max-width: 460px; width: calc(100% - 2rem); }
.modal h2 {
  font-family: var(--display); font-variation-settings: "wdth" 60, "wght" 800;
  font-size: 1.2rem; text-transform: uppercase; letter-spacing: .02em;
  margin-bottom: 1rem;
}

/* ==========================================================================
   AUTH (login, aceitar) — full-page
   ========================================================================== */
.auth-shell {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1.5rem;
  background: var(--bone);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 8px; padding: 2.2rem 2rem;
}
.auth-card h1 {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 850;
  font-size: 1.6rem; text-transform: uppercase; line-height: 1; margin: .4rem 0 1rem;
}
.auth-card p.lede { color: var(--graphite-60); font-style: italic; font-size: .95rem; margin-bottom: 1.5rem; }

/* Google SSO button — sits above the email/password form, distinct from .btn.primary */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  width: 100%; padding: .7rem 1rem;
  background: #fff; color: var(--graphite);
  border: 1px solid var(--graphite-25); border-radius: 6px;
  font-family: var(--body); font-size: .95rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, transform .04s ease;
}
.btn-google:hover { background: rgba(44,73,199,.04); border-color: var(--cobalt); }
.btn-google:active { transform: translateY(1px); }
.btn-google svg { flex: 0 0 18px; }

.auth-divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.1rem 0 1.1rem;
  color: var(--graphite-60); font-size: .75rem; font-family: var(--mono);
  letter-spacing: .12em; text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--graphite-15);
}
.auth-divider span { padding: 0 .25rem; }

/* ==========================================================================
   KANBAN BOARD
   ========================================================================== */
.board-head {
  display: flex; align-items: flex-end; gap: 1rem;
  margin-bottom: 1.4rem; flex-wrap: wrap;
}
.board-head > div:first-child { flex: 1; min-width: 0; }
.board-head h1 {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 800;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem); text-transform: uppercase;
  line-height: 1; margin: 0 0 .35rem 0;
}
.board-head p.lede { color: var(--graphite-60); font-style: italic; font-size: .9rem; }
.board-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.meta-pill {
  display: inline-flex; flex-direction: column; align-items: center;
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 6px; padding: .35rem .65rem; min-width: 70px;
}
.meta-pill .meta-label { font-family: var(--mono); font-size: .55rem; letter-spacing: .12em; text-transform: uppercase; color: var(--graphite-60); }
.meta-pill .meta-value { font-family: var(--display); font-variation-settings: "wdth" 60, "wght" 700; font-size: 1rem; line-height: 1.1; }

.kanban {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem; align-items: start;
}
.kcol {
  background: var(--bone-2); border: 1px solid var(--graphite-15);
  border-radius: 8px; padding: .8rem .8rem .5rem;
  min-height: 200px;
  display: flex; flex-direction: column; gap: .6rem;
}
.kcol-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 .2rem .5rem;
  border-bottom: 1px solid var(--graphite-15);
}
.kcol-name { font-family: var(--mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite-60); }
.kcol-count {
  font-family: var(--mono); font-size: .65rem; color: var(--graphite-60);
  background: rgba(35,33,28,.06); padding: 1px 8px; border-radius: 8px;
}
.kcol-cards { display: flex; flex-direction: column; gap: .55rem; min-height: 40px; }
.kcol-add {
  background: transparent; border: 1px dashed var(--graphite-35);
  color: var(--graphite-60); font-family: var(--mono); font-size: .6rem;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .4rem; border-radius: 5px; cursor: pointer;
  width: 100%;
}
.kcol-add:hover { border-color: var(--cobalt); color: var(--cobalt); }

.kcard {
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 6px; padding: .65rem .7rem;
  display: flex; flex-direction: column; gap: .35rem;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.kcard:hover { border-color: var(--cobalt); box-shadow: 0 2px 8px -3px rgba(44,73,199,.25); }
.kcard-prio {
  display: inline-block; font-family: var(--mono); font-size: .55rem;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; align-self: flex-start;
}
.kcard-title { font-size: .92rem; line-height: 1.3; color: var(--graphite); }
.kcard-meta { display: flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .62rem; color: var(--graphite-60); flex-wrap: wrap; }
.kcard-due.overdue { color: var(--stamp); }
.kcard-comments { color: var(--graphite-60); }
.kcard-assignee {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--cobalt); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .55rem; font-weight: 600;
  margin-left: auto;
}
.kcard-ghost { opacity: .4; }
.kcard-chosen { box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.kcard-drag { transform: rotate(2deg); }

/* ==========================================================================
   CARD DETAIL (side panel)
   ========================================================================== */
.card-detail-back {
  position: fixed; inset: 0; background: rgba(35,33,28,.55);
  display: none; align-items: stretch; justify-content: flex-end; z-index: 60;
}
.card-detail-back.on { display: flex; }
.card-detail {
  width: min(540px, 96vw); background: var(--bone);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 24px -10px rgba(0,0,0,.4);
  animation: slidein .25s ease;
}
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.card-detail-head {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.4rem 1.4rem 1rem;
  border-bottom: 1px solid var(--graphite-15);
}
.card-detail-head > div { flex: 1; min-width: 0; }
.card-detail-head h2 {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 800;
  font-size: 1.25rem; text-transform: none; line-height: 1.2;
  margin: .35rem 0 0;
}
.cd-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.cd-pill {
  display: inline-block; font-family: var(--mono); font-size: .6rem;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px;
  background: var(--bone-2); color: var(--graphite-60);
}
.cd-close {
  background: none; border: 0; color: var(--graphite-60);
  font-size: 1.4rem; cursor: pointer; padding: .25rem .5rem;
  border-radius: 4px; line-height: 1;
}
.cd-close:hover { background: var(--graphite-08); color: var(--graphite); }

.cd-body { padding: 1.2rem 1.4rem 1.4rem; overflow-y: auto; flex: 1; }
.cd-section { margin-bottom: 1.4rem; }
.cd-section h3 {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--graphite-60);
  margin-bottom: .6rem;
}
.cd-desc {
  font-size: .95rem; line-height: 1.55; white-space: pre-wrap;
  color: var(--graphite);
}
.cd-comments { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 1rem; }
.cd-comment {
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 6px; padding: .7rem .85rem;
}
.cd-comment-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.cd-author { font-weight: 500; font-size: .9rem; }
.cd-role {
  font-family: var(--mono); font-size: .55rem; letter-spacing: .12em;
  text-transform: uppercase; padding: 1px 6px; border-radius: 4px;
}
.cd-role-studio { background: var(--cobalt-soft); color: var(--cobalt); }
.cd-role-client { background: rgba(194,135,58,.15); color: var(--amber); }
.cd-time { font-family: var(--mono); font-size: .62rem; color: var(--graphite-60); margin-left: auto; }
.cd-comment-body { font-size: .9rem; line-height: 1.5; }

/* Card history timeline — compact list of "who did what when" */
.cd-history { display: flex; flex-direction: column; gap: .45rem; }
.cd-h-row {
  display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap;
  font-size: .82rem; line-height: 1.4;
  padding: .35rem 0;
  border-bottom: 1px solid var(--graphite-15);
}
.cd-h-row:last-child { border-bottom: none; }
.cd-h-actor { font-weight: 600; color: var(--graphite); }
.cd-h-verb { color: var(--graphite-60); }
.cd-h-from, .cd-h-to {
  font-family: var(--mono); font-size: .72rem;
  background: var(--bone); padding: .1rem .45rem; border-radius: 3px;
  color: var(--graphite);
}
.cd-h-arrow { color: var(--graphite-60); font-family: var(--mono); }
.cd-h-when { margin-left: auto; font-family: var(--mono); font-size: .7rem; color: var(--graphite-60); }
.cd-cmt-form { display: flex; flex-direction: column; gap: .5rem; }
.cd-cmt-form textarea {
  width: 100%; font-family: var(--body); font-size: .9rem; padding: .55rem .7rem;
  background: #fff; border: 1px solid var(--graphite-35); border-radius: 4px;
}
.cd-cmt-form textarea:focus { outline: none; border-color: var(--cobalt); }
.cd-cmt-form button { align-self: flex-end; }

/* ==========================================================================
   PROJECT PICKER (board view)
   ========================================================================== */
.ppicker {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.ppicker a {
  font-family: var(--mono); font-size: .65rem; letter-spacing: .12em;
  text-transform: uppercase; padding: .35rem .7rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--graphite-15); color: var(--graphite);
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.ppicker a:hover { border-color: var(--cobalt); color: var(--cobalt); text-decoration: none; }
.ppicker a.is-active { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }

/* ==========================================================================
   MULTI-PROJECT BOARD (admin)
   ========================================================================== */
.board-filter {
  display: flex; gap: .45rem; flex-wrap: wrap;
  margin: -.4rem 0 1.2rem;
}
.board-filter-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; padding: .35rem .75rem .35rem .5rem;
  border-radius: 999px;
  background: #fff; border: 1px solid var(--graphite-15); color: var(--graphite);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.board-filter-chip:hover { border-color: var(--cobalt); color: var(--cobalt); }
.board-filter-chip.is-active { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.board-filter-chip.is-active .chip-count { background: rgba(255,255,255,.2); color: #fff; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip-dot-all {
  background: var(--cobalt);
  background: linear-gradient(135deg, var(--cobalt) 0%, var(--cobalt) 50%, var(--amber) 50%, var(--amber) 100%);
}
.chip-count {
  font-family: var(--mono); font-size: .6rem; color: var(--graphite-60);
  background: rgba(35,33,28,.06); padding: 1px 7px; border-radius: 8px;
}
.kcard-project {
  display: inline-block; font-family: var(--mono); font-size: .55rem;
  letter-spacing: .12em; text-transform: uppercase; padding: 1px 8px;
  border-radius: 4px; align-self: flex-start; color: var(--graphite);
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.kcard-project[title] { cursor: help; }

/* ==========================================================================
   TOAST — quick bottom-right notice
   ========================================================================== */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--graphite); color: var(--bone);
  font-family: var(--body); font-size: .9rem;
  padding: .75rem 1.1rem; border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 100; max-width: 360px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: none; }

/* ==========================================================================
   UPCOMING TASKS — admin overview
   ========================================================================== */
.upcoming-table .upcoming-overdue { color: var(--stamp); font-weight: 500; }
.upcoming-table .upcoming-soon    { color: var(--amber); }
.upcoming-table .upcoming-future  { color: var(--graphite-60); }
.upcoming-table .upcoming-empty   { padding: 1.4rem; text-align: center; color: var(--graphite-60); font-style: italic; }

/* ==========================================================================
   SUMMARY HEADER — project detail page
   ========================================================================== */
.summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .8rem; margin: -.4rem 0 1.4rem;
}
.summary-card {
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 8px; padding: .9rem 1rem;
  display: flex; flex-direction: column; gap: .25rem;
  min-height: 110px;
}
.summary-label {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--graphite-60);
}
.summary-value {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 800;
  font-size: 1.8rem; line-height: 1; color: var(--graphite);
}
.summary-value small {
  font-size: .9rem; font-weight: 500; color: var(--graphite-60); margin-left: 2px;
}
.summary-value-sm {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 700;
  font-size: 1rem; line-height: 1.2; color: var(--graphite);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.summary-sub {
  font-family: var(--mono); font-size: .65rem; color: var(--graphite-60);
  margin-top: auto;
}
.summary-bar {
  width: 100%; height: 6px; background: var(--bone-2);
  border-radius: 999px; overflow: hidden; margin-top: .35rem;
}
.summary-bar-fill {
  height: 100%; background: var(--cobalt);
  transition: width .3s ease;
}
.summary-due-overdue { color: var(--stamp); }
.summary-due-soon    { color: var(--amber); }
.summary-bill-warn   { color: var(--amber); }
.summary-bill-over   { color: var(--stamp); }
.summary-next { background: var(--cobalt-soft); border-color: var(--cobalt); }

/* ==========================================================================
   CARD DETAIL — assignee + files
   ========================================================================== */
.cd-assignee { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cd-assignee-sel {
  font-family: var(--body); font-size: .9rem;
  padding: .4rem .6rem; border: 1px solid var(--graphite-35);
  border-radius: 4px; background: #fff; min-width: 180px;
}
.cd-assignee-current {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .72rem; color: var(--graphite-60);
}
.cd-assignee-current::before {
  content: ''; width: 22px; height: 22px; border-radius: 50%;
  background: var(--cobalt); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: .6rem; font-weight: 600;
}
.cd-assignee-current {
  display: none; /* shown only when the select is populated and an option is set */
}
.cd-files { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .6rem; }
.cd-file {
  display: flex; align-items: center; gap: .55rem;
  background: var(--bone-2); border: 1px solid var(--graphite-15);
  border-radius: 5px; padding: .45rem .6rem;
}
.cd-file-ext {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 3px;
  background: var(--graphite); color: #fff; text-transform: uppercase;
  flex-shrink: 0; min-width: 36px; text-align: center;
}
.cd-file-ext-pdf  { background: #b3232e; }
.cd-file-ext-jpg, .cd-file-ext-png, .cd-file-ext-webp, .cd-file-ext-svg { background: #2c49c7; }
.cd-file-ext-ai, .cd-file-ext-psd, .cd-file-ext-skt { background: #c2873a; }
.cd-file-ext-zip, .cd-file-ext-rar, .cd-file-ext-7z { background: #5b5b5b; }
.cd-file-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--graphite); text-decoration: none;
  font-size: .9rem;
}
.cd-file-name:hover { color: var(--cobalt); }
.cd-file-meta { font-family: var(--mono); font-size: .62rem; color: var(--graphite-60); }
.cd-file-del {
  background: none; border: 0; color: var(--graphite-60);
  cursor: pointer; font-size: 1rem; padding: 0 .25rem;
}
.cd-file-del:hover { color: var(--stamp); }
.cd-file-drop {
  display: block; padding: .7rem 1rem; text-align: center;
  background: var(--bone-2); border: 1px dashed var(--graphite-35);
  border-radius: 5px; cursor: pointer; font-size: .85rem;
  color: var(--graphite-60); transition: border-color .15s, background .15s;
}
.cd-file-drop:hover, .cd-file-drop.on {
  border-color: var(--cobalt); background: var(--cobalt-soft);
  color: var(--cobalt);
}
.cd-file-status {
  margin-top: .4rem; font-family: var(--mono); font-size: .72rem;
  color: var(--graphite-60);
}

/* ==========================================================================
   PROJECT FILES — full section on the project page
   ========================================================================== */
.project-files { margin-top: 1.6rem; }
.project-files-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .7rem;
}
.project-files-head h2 {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 800;
  font-size: 1.1rem; text-transform: uppercase; letter-spacing: .04em;
  margin: 0;
}
.project-files-list { display: flex; flex-direction: column; gap: .35rem; }
.project-files-empty {
  padding: 1.4rem; text-align: center; color: var(--graphite-60);
  background: var(--bone-2); border: 1px dashed var(--graphite-15);
  border-radius: 6px; font-style: italic;
}

/* ==========================================================================
   CARD DETAIL — time entries
   ========================================================================== */
.cd-section-aside {
  float: right; font-family: var(--mono); font-size: .7rem;
  color: var(--graphite-60); font-weight: 400; letter-spacing: 0;
  text-transform: none;
}
.cd-time-form {
  display: flex; gap: .4rem; align-items: stretch; margin-bottom: .6rem;
}
.cd-time-form input[type="number"] {
  width: 80px; flex-shrink: 0;
  font-family: var(--mono); font-size: .9rem;
  padding: .4rem .55rem; border: 1px solid var(--graphite-35); border-radius: 4px;
  background: #fff;
}
.cd-time-form input[type="text"] {
  flex: 1; min-width: 0;
  font-family: var(--body); font-size: .9rem;
  padding: .4rem .55rem; border: 1px solid var(--graphite-35); border-radius: 4px;
  background: #fff;
}
.cd-time-form input:focus { outline: none; border-color: var(--cobalt); }
.cd-time-entries { display: flex; flex-direction: column; gap: .3rem; }
.cd-time-row {
  display: grid; grid-template-columns: 60px 1fr auto 18px;
  gap: .55rem; align-items: center;
  background: var(--bone-2); border: 1px solid var(--graphite-15);
  border-radius: 5px; padding: .35rem .55rem;
  font-size: .88rem;
}
.cd-time-h { font-family: var(--mono); font-weight: 600; color: var(--cobalt); }
.cd-time-note { color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-time-meta { font-family: var(--mono); font-size: .62rem; color: var(--graphite-60); }
.cd-time-del {
  background: none; border: 0; color: var(--graphite-60);
  cursor: pointer; font-size: .9rem; padding: 0;
}
.cd-time-del:hover { color: var(--stamp); }

/* ==========================================================================
   FINANCE DASHBOARD
   ========================================================================== */
.fin-sel {
  font-family: var(--mono); font-size: .75rem;
  padding: .35rem .6rem; border: 1px solid var(--graphite-35);
  border-radius: 4px; background: #fff; color: var(--graphite);
  text-transform: uppercase; letter-spacing: .06em;
}
.fin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .8rem; margin-bottom: 1.6rem;
}
.fin-stat {
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 8px; padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .25rem; min-height: 110px;
}
.fin-stat-label {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--graphite-60);
}
.fin-stat-value {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 800;
  font-size: 1.9rem; line-height: 1; color: var(--graphite);
}
.fin-stat-value small { font-size: 1rem; font-weight: 500; color: var(--graphite-60); margin-left: 2px; }
.fin-stat-sub { font-family: var(--mono); font-size: .65rem; color: var(--graphite-60); margin-top: auto; }
.fin-stat-bar {
  height: 4px; background: var(--graphite-08);
  border-radius: 2px; overflow: hidden; margin-top: .35rem;
}
.fin-stat-bar-fill {
  height: 100%; background: var(--cobalt);
  border-radius: 2px; transition: width .4s ease;
}
.fin-spark { margin-top: .3rem; opacity: .85; }

.fin-chart {
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 8px; padding: 1rem 1.1rem .8rem; margin-bottom: .5rem;
}
.fin-chart h2 {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 700;
  font-size: .9rem; text-transform: uppercase; letter-spacing: .08em;
  margin: 0 0 .7rem; color: var(--graphite-60);
}
.fin-chart svg { display: block; max-width: 100%; }
.fin-chart-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: .75rem; color: var(--graphite-60);
  margin-top: .4rem; padding-top: .4rem; border-top: 1px dashed var(--graphite-15);
}
.fin-chart-foot b { color: var(--graphite); font-weight: 600; }

.fin-table th.num, .fin-table td.num { text-align: right; }
.fin-table .fin-bill-warn { color: var(--amber); font-weight: 500; }
.fin-table .fin-bill-over  { color: var(--stamp); font-weight: 600; }

.fin-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start;
}
@media (max-width: 900px) {
  .fin-two-col { grid-template-columns: 1fr; }
}

/* ==========================================================================
   NOTIFICATION BELL — topbar dropdown
   ========================================================================== */
.topbar-bell { position: relative; }
.bell-btn {
  position: relative;
  background: none; border: 0; cursor: pointer;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--graphite); padding: 0;
}
.bell-btn:hover { background: var(--bone-2); }
.bell-btn .icon { width: 18px; height: 18px; }
.bell-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 5px;
  background: var(--stamp); color: #fff;
  font-family: var(--mono); font-size: .6rem; font-weight: 600;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--bone);
  line-height: 1;
}
.bell-badge[hidden] { display: none; }  /* override the .bell-badge display:inline-flex so the [hidden] attribute actually hides it */
.bell-dropdown[hidden] { display: none; }  /* same fix for the dropdown — display:flex would otherwise override [hidden] */
.bell-backdrop {
  position: fixed; inset: 0;
  background: rgba(35, 33, 28, .08);
  /* No blur — earlier backdrop-filter:blur(2px) made the page behind
     unreadable, the dropdown felt like it was floating in front of a
     frosted wall. Just a soft dim is enough to signal focus. */
  z-index: 90;
  opacity: 0; transition: opacity .15s ease;
  pointer-events: none;
}
.bell-backdrop.on { opacity: 1; pointer-events: auto; }
.bell-dropdown {
  position: absolute; top: calc(100% + .5rem); right: 0;
  width: 380px; max-width: calc(100vw - 2rem);
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 8px; box-shadow: 0 8px 24px -8px rgba(0,0,0,.25);
  z-index: 100; max-height: 70vh; display: flex; flex-direction: column;
}
.bell-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem; border-bottom: 1px solid var(--graphite-15);
  flex-shrink: 0;
}
.bell-head h3 {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 800;
  font-size: .9rem; text-transform: uppercase; letter-spacing: .08em;
  margin: 0; color: var(--graphite);
}
.bell-list { overflow-y: auto; }
.bell-item {
  display: block; position: relative;
  padding: .7rem 2rem .7rem 1rem;
  border-bottom: 1px solid var(--graphite-15);
  text-decoration: none; color: var(--graphite);
  font-size: .88rem; line-height: 1.4;
  transition: background .1s;
}
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--bone-2); }
.bell-item.unread { background: var(--cobalt-soft); }
.bell-item.unread:hover { background: #d8e1f5; }
.bell-item-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .25rem;
}
.bell-item-type {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .08em;
  text-transform: uppercase; padding: 1px 6px; border-radius: 3px;
  background: var(--graphite-15); color: var(--graphite);
  display: inline-flex; align-items: center; gap: .3rem;
}
.bell-item-icon { font-size: .85rem; line-height: 1; }
.bell-type-client_comment    { background: var(--cobalt-soft); color: var(--cobalt); }
.bell-type-client_file       { background: rgba(194,135,58,.18); color: var(--amber); }
.bell-type-studio_comment    { background: var(--cobalt-soft); color: var(--cobalt); }
.bell-type-studio_file       { background: rgba(194,135,58,.18); color: var(--amber); }
.bell-type-card_moved        { background: var(--graphite-08); color: var(--graphite); }
.bell-type-card_created      { background: var(--graphite-08); color: var(--graphite); }
.bell-type-project_completed { background: rgba(34,140,76,.15); color: #1e8e3e; }
.bell-type-project_status    { background: var(--graphite-08); color: var(--graphite); }
.bell-item-time {
  font-family: var(--mono); font-size: .62rem; color: var(--graphite-60);
}
.bell-item-title {
  font-size: .82rem; font-weight: 600; color: var(--graphite);
  margin-bottom: .15rem; letter-spacing: -.005em;
}
.bell-item-msg {
  font-size: .85rem; color: var(--graphite-60);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-height: 1.35;
}
.bell-item-dismiss {
  position: absolute; top: .5rem; right: .5rem;
  background: none; border: 0; color: var(--graphite-60);
  cursor: pointer; font-size: .85rem; padding: 2px 6px;
  border-radius: 3px; line-height: 1;
}
.bell-item-dismiss:hover { background: var(--graphite-08); color: var(--stamp); }

/* ==========================================================================
   TABLE ACTIONS — last column with the "Abrir" button on project lists
   ========================================================================== */
.table { table-layout: auto; }
.table th, .table td { overflow-wrap: anywhere; word-break: break-word; }
.table th.row-actions, .table td.row-actions {
  text-align: right; width: 1%; white-space: nowrap; padding-left: 1rem;
  border-bottom-color: transparent;  /* prevent the empty header cell from
                                       showing a stray line in the action col */
}
.table thead th.row-actions { border-bottom-color: var(--graphite-15); }
/* Empty action header (e.g. "<th class='row-actions'></th>") collapses to
   just the padding because there's no content, so the cell looks shorter
   than the other th cells and the bone-2 header background is barely
   visible. Pad it to match the line-height of the other th cells. */
.table thead th.row-actions:empty::before { content: '\00a0'; }
.table td.row-actions .btn { padding: .3rem .7rem; font-size: .72rem; }
.table tr td.row-actions { padding-right: 1rem; }
.table tr:hover td.row-actions { background: transparent; }  /* keep action col clean on row hover */

/* Per-row navigation buttons default to ghost (less visual weight than
   the page's primary CTA). Pages can override with .row-actions .btn.primary
   if they really want a primary button in a row. */
.table .row-actions .btn { background: transparent; color: var(--graphite); border-color: var(--graphite-35); }
.table .row-actions .btn:hover { border-color: var(--graphite); color: var(--graphite); }

/* Project / client name links in tables: keep the title graphite, not the
   default cobalt link color. The button in the action column is the
   primary affordance, not the title. */
.table .name a { color: var(--graphite); text-decoration: none; }
.table .name a:hover { color: var(--cobalt); text-decoration: none; }
.table .name small { color: var(--graphite-60); display: block; font-weight: 400; font-size: .8rem; }

/* ==========================================================================
   PAGE-LEVEL HELPERS — back link, loading state, inline empty hint
   ========================================================================== */
.page-back {
  margin: 0 0 1rem;
}
.page-back a {
  display: inline-flex; align-items: center; gap: .25rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--graphite-60);
  text-decoration: none; padding: .25rem 0;
}
.page-back a:hover { color: var(--cobalt); text-decoration: none; }
.page-loading {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  padding: 3rem 1rem; color: var(--graphite-60);
  font-family: var(--mono); font-size: .8rem; letter-spacing: .12em;
  text-transform: uppercase;
}
.page-loading .spinner { width: 18px; height: 18px; border-width: 2px; }

/* ==========================================================================
   UPCOMING TASKS — overview "Próximas tarefas" table
   ========================================================================== */
.upcoming-table td { vertical-align: middle; }
.upcoming-table .name a { color: var(--graphite); }
.upcoming-table .name a:hover { color: var(--cobalt); }
.upcoming-overdue { color: var(--stamp); }
.upcoming-soon    { color: var(--amber); }
.upcoming-future  { color: var(--graphite-60); }
.upcoming-empty {
  background: var(--bone-2); border: 1px dashed var(--graphite-35);
  border-radius: 6px; padding: 2rem 1rem; text-align: center;
  color: var(--graphite-60); font-style: italic;
}

/* ==========================================================================
   PORTAL — client-side "My projects" page (list of project cards)
   Distinct from the admin tables: each project is a card, not a row, so
   a 1-5 project list still feels personal and not like a database view.
   ========================================================================== */
.portal-summary {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--graphite-60);
  margin: -.4rem 0 1.4rem;
}
.portal-section {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--graphite-60);
  margin: 1.4rem 0 .6rem; font-weight: 500;
}
.portal-cards { display: flex; flex-direction: column; gap: .7rem; }
.portal-card {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr max-content;
  gap: 1.4rem; align-items: center;
  padding: 1.1rem 1.4rem;
  background: #fff; border: 1px solid var(--graphite-15);
  border-left: 4px solid var(--cobalt);
  border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
@media (max-width: 720px) {
  .portal-card {
    grid-template-columns: 1fr;
    gap: .6rem;
  }
  .portal-card-status { justify-self: start; }
  .portal-card-cta { justify-self: start; }
}
.portal-card:hover {
  border-color: var(--graphite-35);
  box-shadow: 0 6px 18px -10px rgba(0,0,0,.18);
  text-decoration: none;
}
.portal-card:hover .portal-card-arrow { transform: translateX(3px); }
.portal-card.is-completed { border-left-color: var(--graphite-35); }
.portal-card.is-completed .portal-card-name { color: var(--graphite-60); }
.portal-card-status { flex-shrink: 0; }
.portal-card-body { min-width: 0; }
.portal-card-name {
  font-family: var(--display);
  font-variation-settings: "wdth" 70, "wght" 800;
  font-size: 1.2rem; line-height: 1.2; margin: 0 0 .25rem;
  color: var(--graphite); letter-spacing: -.005em;
}
.portal-card-desc {
  font-style: italic; color: var(--graphite-60);
  font-size: .9rem; margin: 0 0 .4rem; line-height: 1.4;
}
.portal-card-meta {
  display: flex; gap: 1.1rem; flex-wrap: wrap;
  font-size: .72rem; color: var(--graphite-60);
}
.portal-due-stamp    { color: var(--stamp); font-weight: 500; }
.portal-due-amber    { color: var(--amber); font-weight: 500; }
.portal-due-graphite { color: var(--graphite-60); }
.portal-card-cta {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cobalt);
  display: inline-flex; align-items: center; gap: .25rem;
  white-space: nowrap;
}
.portal-card-arrow {
  display: inline-block; transition: transform .15s ease;
  font-size: 1rem; line-height: 1;
}

/* ==========================================================================
   PROJECT FILTERS — search + status tabs + due-date select
   ========================================================================== */
.proj-filters {
  display: flex; flex-direction: column; gap: .8rem;
  margin: -.4rem 0 1.2rem;
  padding: .9rem 1rem;
  background: #fff; border: 1px solid var(--graphite-15); border-radius: 8px;
}
.proj-filters-row {
  display: flex; gap: .55rem; flex-wrap: wrap; align-items: center;
}
.proj-search {
  flex: 1; min-width: 200px;
  font-family: var(--body); font-size: .9rem;
  padding: .5rem .7rem; background: var(--bone);
  border: 1px solid var(--graphite-15); border-radius: 5px;
  color: var(--graphite);
}
.proj-search:focus { outline: none; border-color: var(--cobalt); background: #fff; }
.proj-search::placeholder { color: var(--graphite-60); font-style: italic; }
.proj-due-sel {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .08em;
  padding: .45rem .6rem; background: var(--bone);
  border: 1px solid var(--graphite-15); border-radius: 5px;
  color: var(--graphite); cursor: pointer;
}
.proj-due-sel:focus { outline: none; border-color: var(--cobalt); }
.proj-tabs {
  display: flex; gap: .4rem; flex-wrap: wrap;
}
.proj-tab {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: .65rem; letter-spacing: .12em;
  text-transform: uppercase; padding: .35rem .75rem;
  border-radius: 999px;
  background: var(--bone-2); border: 1px solid var(--graphite-15);
  color: var(--graphite-60); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.proj-tab:hover { border-color: var(--cobalt); color: var(--cobalt); }
.proj-tab.is-active {
  background: var(--cobalt); color: #fff; border-color: var(--cobalt);
}
.proj-tab.is-active .proj-tab-n {
  background: rgba(255, 255, 255, .2); color: #fff;
}
.proj-tab-n {
  font-family: var(--mono); font-size: .58rem;
  background: rgba(35, 33, 28, .08);
  padding: 1px 7px; border-radius: 8px; min-width: 18px; text-align: center;
  color: var(--graphite-60);
}

/* ==========================================================================
   TIME ENTRY EDIT BUTTON
   ========================================================================== */
.cd-time-row {
  /* was 60px 1fr auto 18px — now has 5 columns: hours | note | meta | edit | del */
  grid-template-columns: 60px 1fr auto auto 18px;
}
.cd-time-edit {
  background: none; border: 0; color: var(--graphite-60);
  cursor: pointer; font-size: .85rem; padding: 0 .15rem;
  line-height: 1;
}
.cd-time-edit:hover { color: var(--cobalt); }

/* ==========================================================================
   FILE PREVIEW — inline image thumb + PDF modal
   ========================================================================== */
.cd-file-preview {
  background: none; border: 0; color: var(--graphite-60);
  cursor: pointer; font-size: .95rem; padding: 0 .25rem;
  line-height: 1;
}
.cd-file-preview:hover { color: var(--cobalt); }
.cd-file-thumb-row {
  display: flex; align-items: center; gap: .6rem;
  background: var(--bone-2); border: 1px solid var(--graphite-15);
  border-top: 0; border-radius: 0 0 5px 5px;
  padding: .55rem .7rem; margin: -.35rem 0 .35rem;
  margin-left: 36px; /* align under the filename, past the ext pill */
}
.cd-file-thumb-link {
  display: flex; align-items: center; gap: .55rem;
  text-decoration: none; color: inherit;
  min-width: 0; max-width: 100%;
}
.cd-file-thumb-link:hover { text-decoration: none; }
.cd-file-thumb {
  max-width: 180px; max-height: 120px;
  border-radius: 4px; border: 1px solid var(--graphite-15);
  background: #fff; display: block; object-fit: contain;
}
.cd-file-thumb-name {
  font-family: var(--mono); font-size: .7rem;
  color: var(--graphite-60);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Preview modal (PDF / large image) — full-screen overlay with the browser's
   built-in PDF viewer or a centered image. */
.preview-back {
  position: fixed; inset: 0; background: rgba(35, 33, 28, .75);
  display: flex; align-items: stretch; justify-content: center;
  z-index: 80; padding: 2vh 2vw;
}
.preview-back[hidden] { display: none; }  /* keep [hidden] working — display:flex would otherwise override it */
.preview-modal {
  background: #fff; border-radius: 8px;
  display: flex; flex-direction: column; width: 100%; max-width: 1200px;
  max-height: 96vh; overflow: hidden;
  box-shadow: 0 16px 48px -12px rgba(0, 0, 0, .5);
}
.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1.1rem; border-bottom: 1px solid var(--graphite-15);
  background: var(--bone);
}
.preview-title {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .04em;
  color: var(--graphite); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0; flex: 1;
}
.preview-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.preview-frame {
  width: 100%; flex: 1; border: 0; background: var(--bone-2);
  min-height: 60vh;
}

/* ==========================================================================
   PROFILE PAGE (portal/perfil.html) — three side-by-side cards
   ========================================================================== */
.profile-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--cobalt); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 800;
  font-size: 1.4rem;
}
.profile-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
@media (max-width: 760px) {
  .profile-grid { grid-template-columns: 1fr; }
}
.profile-card {
  background: #fff; border: 1px solid var(--graphite-15);
  border-radius: 8px; padding: 1.2rem 1.3rem;
}
.profile-card h2 {
  font-family: var(--display); font-variation-settings: "wdth" 70, "wght" 800;
  font-size: 1rem; text-transform: uppercase; letter-spacing: .04em;
  margin: 0 0 .25rem;
}
.profile-hint {
  font-size: .85rem; color: var(--graphite-60); font-style: italic;
  margin: 0 0 1rem; line-height: 1.5;
}
.profile-form { display: flex; flex-direction: column; gap: 0; }
.profile-form .field { margin-bottom: .8rem; }
.profile-actions { display: flex; justify-content: flex-end; margin-top: .25rem; }
.profile-info { background: var(--bone-2); }
.profile-dl {
  display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem;
  font-size: .88rem; margin: 0;
}
.profile-dl dt {
  font-family: var(--mono); font-size: .65rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--graphite-60);
  align-self: center;
}
.profile-dl dd { margin: 0; color: var(--graphite); }
