:root {
  --brand: #7ab82f;
  --brand-dark: color-mix(in srgb, var(--brand) 78%, #000);
  --st-pendiente: #6c757d;
  --st-produccion: #e8a317;
  --st-completada: #7ab82f;
  --st-programada: #3b82f6;
  --st-arrastrada: #dc3545;
  --radius: 10px;
}
[data-bs-theme="dark"] { --bs-body-bg: #16181b; --surface: #1f2226; }
[data-bs-theme="light"] { --bs-body-bg: #f4f5f4; --surface: #ffffff; }

body { font-size: 14.5px; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-icon { border: 0; background: transparent; color: inherit; padding: .25rem .45rem; font-size: 1.1rem; }
.brand-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); margin-right: 8px; }

/* login */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bs-body-bg); }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--bs-border-color); border-radius: var(--radius); padding: 28px; margin: 16px; }
.login-brand { font-weight: 600; font-size: 1.15rem; margin-bottom: 18px; display: flex; align-items: center; }

/* cabecera */
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--bs-border-color); }
.brand { display: flex; align-items: center; font-weight: 600; color: inherit; text-decoration: none; white-space: nowrap; }
.views { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.views a { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; color: var(--bs-secondary-color);
  text-decoration: none; white-space: nowrap; }
.views a:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.views a.active { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand-dark); font-weight: 500; }
[data-bs-theme="dark"] .views a.active { color: color-mix(in srgb, var(--brand) 60%, #fff); }
.top-actions { display: flex; align-items: center; gap: 6px; }
@media (max-width: 767px) { .views a span { display: none; } .views a { padding: 6px 10px; font-size: 1.05rem; } }

.app { padding: 16px; max-width: 1500px; margin: 0 auto; }
.card-z { background: var(--surface); border: 1px solid var(--bs-border-color); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.z-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); margin: 0 0 10px; font-weight: 600; }

/* barra de mes */
.monthbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.monthbar h1 { font-size: 1.35rem; margin: 0; min-width: 190px; text-transform: capitalize; }
.monthbar .tag-now { font-size: .75rem; }

/* filtros */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .dropdown-menu { max-height: 340px; overflow: auto; min-width: 220px; }
.filters .dropdown-item { display: flex; align-items: center; gap: 8px; }
.filter-btn { border: 1px solid var(--bs-border-color); background: transparent; border-radius: 20px; padding: 4px 12px; font-size: .88rem; color: inherit; }
.filter-btn.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.filters input[type=search] { max-width: 220px; border-radius: 20px; }

/* línea de tiempo (zona) */
.tl { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(96px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.tl-m { border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: .82rem; }
.tl-m:hover { background: var(--bs-tertiary-bg); }
.tl-m.sel { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.tl-m .n { text-transform: capitalize; font-weight: 500; }
.tl-m .now { color: var(--brand-dark); font-size: .7rem; margin-left: 4px; }
.tl-bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--bs-tertiary-bg); margin: 6px 0 4px; }
.tl-bar span { display: block; }
.tl-m .sub { color: var(--bs-secondary-color); }

/* layout mes */
.month-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 991px) { .month-grid { grid-template-columns: minmax(0, 1fr); } }

.group-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; cursor: pointer; user-select: none; }
.group-h:first-child { margin-top: 0; }
.group-h .count { color: var(--bs-secondary-color); font-weight: 400; }
.group-h .bi-chevron-down { transition: transform .15s; }
.group-h.closed .bi-chevron-down { transform: rotate(-90deg); }

.trow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-top: 1px solid var(--bs-border-color); cursor: pointer; }
.trow:hover { background: var(--bs-tertiary-bg); }
.trow .title { flex: 1; min-width: 0; }
.trow .title b { font-weight: 500; }
.trow.done .title b { color: var(--bs-secondary-color); text-decoration: line-through; }
.trow .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: .78rem; color: var(--bs-secondary-color); }
.trow .right { display: flex; align-items: center; gap: 8px; }

.prio { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prio-1 { background: #dc3545; } .prio-2 { background: #e8a317; } .prio-3 { background: #adb5bd; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.pill-area { background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--bs-body-color)); }
.st { font-size: .74rem; padding: 2px 9px; border-radius: 10px; white-space: nowrap; color: #fff; }
.st-pendiente { background: var(--st-pendiente); } .st-produccion { background: var(--st-produccion); }
.st-completada { background: var(--st-completada); } .st-programada { background: var(--st-programada); }
.st-arrastrada { background: transparent; color: var(--st-arrastrada); border: 1px solid var(--st-arrastrada); }
.badge-soft { font-size: .74rem; color: var(--bs-secondary-color); }
.late { color: #dc3545 !important; font-weight: 500; }

.avatar { --c: var(--brand); width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--c); color: #fff; font-size: .72rem; font-weight: 600; flex: none; }
.avatars { display: flex; }
.avatars .avatar { width: 24px; height: 24px; margin-left: -6px; border: 2px solid var(--surface); }
.avatars .avatar:first-child { margin-left: 0; }

/* estadísticas */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bs-tertiary-bg); border-radius: 8px; padding: 10px; }
.stat .l { font-size: .76rem; color: var(--bs-secondary-color); }
.stat .v { font-size: 1.4rem; font-weight: 600; line-height: 1.2; }
.progress-thin { height: 8px; }
.hbar { display: grid; grid-template-columns: 90px 1fr 42px; align-items: center; gap: 8px; font-size: .82rem; margin: 6px 0; }
.hbar .track { height: 8px; background: var(--bs-tertiary-bg); border-radius: 4px; overflow: hidden; display: flex; }
.hbar .track span { display: block; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tablero */
.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.col { background: var(--bs-tertiary-bg); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col.drop { outline: 2px dashed var(--brand); }
.col-h { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.tcard { background: var(--surface); border: 1px solid var(--bs-border-color); border-left: 4px solid var(--c, transparent); border-radius: 8px;
  padding: 9px 10px; margin-bottom: 8px; cursor: pointer; }
.tcard:hover { border-color: var(--bs-secondary-color); }
.tcard[draggable=true] { cursor: grab; }
.tcard .tt { font-weight: 500; margin-bottom: 4px; }
.tcard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .76rem; color: var(--bs-secondary-color); }
.tcard.done .tt { text-decoration: line-through; color: var(--bs-secondary-color); }

/* línea de tiempo (vista) */
.lt { display: grid; gap: 10px; overflow-x: auto; }
.lt-col { background: var(--bs-tertiary-bg); border-radius: var(--radius); padding: 10px; min-width: 220px; }
.lt-col.cur { outline: 2px solid var(--brand); }
.lt-col h3 { font-size: .95rem; text-transform: capitalize; margin: 0 0 8px; display: flex; justify-content: space-between; }
.lt-cont { display: grid; gap: 4px 10px; margin-bottom: 12px; font-size: .82rem; }
.lt-band { background: color-mix(in srgb, var(--c, #6c757d) 22%, transparent); border-left: 4px solid var(--c, #6c757d); border-radius: 6px;
  padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

/* empleados */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; align-items: start; }
.person-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }

/* modal de tarea */
.task-title-input { font-size: 1.25rem; font-weight: 500; border: 0; padding-left: 0; background: transparent; }
.task-title-input:focus { box-shadow: none; }
.side-lbl { font-size: .75rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.user-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--bs-border-color); border-radius: 20px; padding: 2px 10px 2px 3px; cursor: pointer; font-size: .85rem; user-select: none; }
.user-chip.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.user-chip .avatar { width: 22px; height: 22px; font-size: .68rem; }
.checks .ck { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.checks .ck input[type=text] { border: 0; border-bottom: 1px dashed transparent; background: transparent; flex: 1; padding: 2px 0; }
.checks .ck input[type=text]:focus { outline: 0; border-bottom-color: var(--bs-border-color); }
.checks .ck.done input[type=text] { text-decoration: line-through; color: var(--bs-secondary-color); }
.checks .ck .del { opacity: 0; } .checks .ck:hover .del { opacity: 1; }
.log-item { font-size: .82rem; padding: 6px 0; border-bottom: 1px solid var(--bs-border-color); }
.log-item .when { color: var(--bs-secondary-color); font-size: .76rem; }
.comment { padding: 8px 0; border-bottom: 1px solid var(--bs-border-color); }
.comment .who { font-weight: 500; font-size: .85rem; }
.comment .txt { white-space: pre-wrap; }
.kind-seg .btn { font-size: .82rem; }
.tox-tinymce { border-radius: 8px !important; }

.empty { text-align: center; color: var(--bs-secondary-color); padding: 28px 10px; }
.table-cfg td, .table-cfg th { vertical-align: middle; }
.swatch { width: 18px; height: 18px; border-radius: 4px; display: inline-block; vertical-align: middle; }
.nav-pills .nav-link { color: var(--bs-secondary-color); }
.nav-pills .nav-link.active { background: var(--brand); color: #fff; }

/* menú de aplicaciones */
.apps-menu { width: 300px; padding: 10px; }
.apps-menu h6 { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); margin: 6px 4px; }
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 6px; }
.apps-grid a { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 8px; color: inherit; text-decoration: none; font-size: .8rem; text-align: center; }
.apps-grid a:hover { background: var(--bs-tertiary-bg); }
.apps-grid i { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 1.05rem; }
.brand img { height: 24px; margin-right: 8px; }
.pill-client { border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--bs-body-color)); }
.client-chip .swatch { width: 12px; height: 12px; border-radius: 3px; }
