/* =========================================
   LETRIVA PREMIUM VISUAL SYSTEM
========================================= */

:root {
  --background: #f4f5f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;

  --border: #e5e7eb;
  --border-strong: #d7dbe2;

  --text: #111827;
  --text-soft: #667085;
  --text-muted: #98a2b3;

  --navy: #0f1724;
  --navy-soft: #182235;

  --blue: #3157d5;
  --blue-dark: #2748bd;

  --gold: #c4a469;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm:
    0 1px 2px rgba(16,24,40,.03);

  --shadow-md:
    0 8px 24px rgba(16,24,40,.06);

  --shadow-lg:
    0 20px 55px rgba(16,24,40,.12);
}


/* =========================================
   DARK
========================================= */

html[data-theme="dark"] {

  --background: #0b0f14;
  --surface: #12171e;
  --surface-raised: #171d25;

  --border: #252c35;
  --border-strong: #303944;

  --text: #f2f4f7;
  --text-soft: #a3acb9;
  --text-muted: #727d8c;

  --navy: #080c11;
  --navy-soft: #111821;

  --blue: #6d82e6;
  --blue-dark: #8294ec;

  --gold: #cfb57c;

  --shadow-sm:
    0 1px 2px rgba(0,0,0,.15);

  --shadow-md:
    0 10px 30px rgba(0,0,0,.20);

  --shadow-lg:
    0 25px 65px rgba(0,0,0,.40);
}


/* =========================================
   GLOBAL
========================================= */

body {
  background: var(--background);
  color: var(--text);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.main-content {
  background: var(--background);
}


/* =========================================
   HEADINGS
========================================= */

.welcome-row h1,
.page-header h1,
.section-header h2,
.settings-header h1 {

  color: var(--text);

  font-family:
    "Playfair Display",
    serif;

  letter-spacing: -.035em;
}


/* =========================================
   TOPBAR
========================================= */

.topbar {

  background: var(--surface);

  border-bottom:
    1px solid var(--border);

  box-shadow:
    var(--shadow-sm);
}


/* =========================================
   DASHBOARD
========================================= */

.dashboard {

  max-width: 1280px;

  padding:
    48px 44px 70px;
}


/* =========================================
   STAT CARDS
========================================= */

.stat-card {

  background: var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-lg);

  box-shadow:
    var(--shadow-sm);

  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.stat-card:hover {

  transform:
    translateY(-2px);

  border-color:
    var(--border-strong);

  box-shadow:
    var(--shadow-md);
}


/* =========================================
   TASKS
========================================= */

.task {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-md);

  box-shadow:
    var(--shadow-sm);

  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.task:hover {

  transform:
    translateY(-1px);

  border-color:
    var(--border-strong);

  box-shadow:
    var(--shadow-md);
}


/* Línea lateral más elegante */

.task::before {

  width: 2px;

  top: 17px;

  height:
    calc(100% - 34px);

  border-radius:
    0 3px 3px 0;

  background:
    var(--blue);
}


/* =========================================
   CASES
========================================= */

.case-card {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-lg);

  box-shadow:
    var(--shadow-sm);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.case-card:hover {

  transform:
    translateY(-2px);

  border-color:
    var(--border-strong);

  box-shadow:
    var(--shadow-md);
}


/* =========================================
   CLIENTS
========================================= */

.client-card {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-lg);

  box-shadow:
    var(--shadow-sm);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.client-card:hover {

  transform:
    translateY(-2px);

  border-color:
    var(--border-strong);

  box-shadow:
    var(--shadow-md);
}


/* =========================================
   FORMS
========================================= */

.form-control,
#client-search-input {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-sm);

  color:
    var(--text);

  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.form-control:hover,
#client-search-input:hover {

  border-color:
    var(--border-strong);
}

.form-control:focus,
#client-search-input:focus {

  border-color:
    var(--blue);

  box-shadow:
    0 0 0 3px
    rgba(49,87,213,.09);

}


/* =========================================
   PRIMARY BUTTON
========================================= */

.primary-btn {

  background:
    var(--blue);

  border-radius:
    var(--radius-sm);

  box-shadow:
    0 2px 6px
    rgba(49,87,213,.18);

  transition:
    transform .15s ease,
    background .15s ease,
    box-shadow .15s ease;
}

.primary-btn:hover {

  background:
    var(--blue-dark);

  transform:
    translateY(-1px);

  box-shadow:
    0 5px 14px
    rgba(49,87,213,.20);
}


/* =========================================
   SECONDARY BUTTON
========================================= */

.secondary-btn {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  color:
    var(--text);

}

.secondary-btn:hover {

  background:
    var(--surface-raised);

  border-color:
    var(--border-strong);
}


/* =========================================
   FILTER
========================================= */

.filter-btn {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  color:
    var(--text-soft);

  border-radius:
    var(--radius-sm);

}


/* =========================================
   MODALS
========================================= */

.task-form,
.task-detail-card,
#client-form,
#case-form {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    18px;

  box-shadow:
    var(--shadow-lg);
}


/* =========================================
   MODAL HEADER / FOOTER
========================================= */

.task-form-header,
.task-detail-header,
.task-form-footer,
.task-detail-footer {

  border-color:
    var(--border);
}

.task-form-footer {

  background:
    var(--surface-raised);
}


/* =========================================
   CALENDAR
========================================= */

.calendar-container {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    18px;

  box-shadow:
    var(--shadow-sm);
}

.calendar-day {

  background:
    var(--surface);

  border-color:
    var(--border);

  border-radius:
    var(--radius-sm);
}


/* =========================================
   SETTINGS
========================================= */

.settings-card {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-lg);

  box-shadow:
    var(--shadow-sm);
}

.settings-card:hover {

  border-color:
    var(--border-strong);

  box-shadow:
    var(--shadow-md);
}


/* =========================================
   ALERTS
========================================= */

.alert-item {

  background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-md);

  box-shadow:
    var(--shadow-sm);
}


/* =========================================
   DARK — SUPERFICIES
========================================= */

html[data-theme="dark"] .task,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .case-card,
html[data-theme="dark"] .client-card,
html[data-theme="dark"] .alert-item,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .calendar-container {

  background:
    var(--surface);
}


/* =========================================
   DARK — WORKSPACE
========================================= */

html[data-theme="dark"] .main-content {

  background:
    #0e1319;
}


/* El fondo de trabajo es algo más profundo,
   pero las tarjetas permanecen diferenciadas */

html[data-theme="dark"] .dashboard,
html[data-theme="dark"] .page-section {

  background:
    transparent;
}


/* =========================================
   DARK — TEXTOS
========================================= */

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] strong {

  color:
    var(--text);
}

html[data-theme="dark"] p {

  color:
    var(--text-soft);
}


/* =========================================
   DARK — INPUTS
========================================= */

html[data-theme="dark"] .form-control,
html[data-theme="dark"] #client-search-input {

  background:
    var(--surface-raised);

  border-color:
    var(--border);

  color:
    var(--text);
}


/* =========================================
   DARK — BUTTONS
========================================= */

html[data-theme="dark"] .secondary-btn {

  background:
    var(--surface-raised);

  color:
    var(--text);

  border-color:
    var(--border);
}


/* =========================================
   DARK — ALERTAS
========================================= */

html[data-theme="dark"] .alert-item {

  background:
    var(--surface);

  border-color:
    var(--border);
}

html[data-theme="dark"] .alert-item.alert-fatal {

  border-left:
    3px solid #b95d67;

  background:
    #17181d;
}

html[data-theme="dark"] .alert-item.alert-overdue {

  border-color:
    #553238;
}


/* =========================================
   DARK — PLAZOS
========================================= */

html[data-theme="dark"] .task-type-badge.procedural {

  background:
    #1b2230;

  color:
    #9caeff;
}

html[data-theme="dark"] .task-type-badge.fatal {

  background:
    #291c20;

  color:
    #d98d96;
}


/* =========================================
   DARK — DETAILS
========================================= */

html[data-theme="dark"] .task-detail-card {

  background:
    #141920;

  border-color:
    #29313a;
}

html[data-theme="dark"] .task-detail-item {

  background:
    #191f27;

  border-color:
    #29313a;
}


/* =========================================
   DARK — SIDEBAR
========================================= */

html[data-theme="dark"] .sidebar {

  background:
    #090d12;

  border-right:
    1px solid #1d242c;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 700px) {

  .dashboard {

    padding:
      32px 18px 50px;

  }

}

:root {
  --navy: #101827;
  --navy-soft: #182337;
  --blue: #3157d5;
  --blue-dark: #2546b7;
  --blue-light: #eef2ff;

  --gold: #c7a86b;
  --gold-light: #f5eddf;

  --white: #ffffff;
  --background: #f6f7fb;
  --surface: #ffffff;
  --border: #e7e9ef;

  --text: #172033;
  --text-soft: #687186;
  --text-muted: #9aa2b1;

  --green: #25845b;
  --green-light: #eaf7f0;

  --danger: #c94b4b;
  --danger-light: #fff0f0;

  --shadow: 0 8px 30px rgba(16, 24, 39, 0.06);
  --shadow-lg: 0 20px 60px rgba(16, 24, 39, 0.14);

  --radius: 12px;
}


/* =========================
   RESET
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(49, 87, 213, 0.18);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}


/* =========================
   TYPOGRAPHY
========================= */

.eyebrow {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}


/* =========================
   BRAND
========================= */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 9px;

  background: linear-gradient(
    145deg,
    #d9bd83,
    #ad8b4e
  );

  color: white;

  font-family: "Playfair Display", serif;
  font-size: 1.25rem;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.3),
    0 5px 15px rgba(150, 115, 54, .18);
}


/* =========================
   AUTH PAGE
========================= */

.auth-page {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 30px;

  background:
 
    #ffffff;

  position: relative;
  overflow: hidden;
}

.auth-decoration {
  position: absolute;

  width: 620px;
  height: 620px;

  border-radius: 50%;

  right: -280px;
  top: -260px;
}

.auth-decoration::after {
  content: "";

  position: absolute;

  width: 430px;
  height: 430px;

  border-radius: 50%;

  right: 80px;
  top: 90px;
}

.auth-card {
  width: 100%;
  max-width: 430px;

  background: rgba(255,255,255,.96);

  border-radius: 18px;

  padding: 42px;



  position: relative;
  z-index: 2;
}

.auth-brand {
  color: var(--navy);
  margin-bottom: 48px;
}

.auth-heading {
  margin-bottom: 30px;
}

.auth-heading h1 {
  margin: 8px 0 8px;

  color: var(--navy);

  font-family: "Playfair Display", serif;
  font-size: 2rem;
  line-height: 1.15;

  letter-spacing: -.025em;
}

.auth-heading p {
  color: var(--text-soft);
  font-size: .92rem;
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}


/* =========================
   INPUTS
========================= */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.input-group label {
  color: var(--text);
  font-size: .78rem;
  font-weight: 600;
}

.form-control,
.input-group input {
  width: 100%;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: #fbfcfe;

  color: var(--text);

  padding: 12px 13px;

  transition:
    border .2s ease,
    box-shadow .2s ease,
    background .2s ease;
}

.form-control::placeholder,
.input-group input::placeholder {
  color: #b0b6c1;
}

.form-control:focus,
.input-group input:focus {
  outline: none;

  border-color: var(--blue);

  background: white;

  box-shadow:
    0 0 0 3px rgba(49,87,213,.08);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}


/* =========================
   BUTTONS
========================= */

.primary-btn {
  min-height: 43px;

  padding: 0 18px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  border-radius: 8px;

  background: var(--blue);

  color: white;

  font-size: .84rem;
  font-weight: 600;

  cursor: pointer;

  transition:all 0.15s ease;

}

.primary-btn:hover {
  background: var(--blue-dark);

}

.none{
  text-decoration:none;
}

.auth-main-btn {
  width: 100%;
  margin-top: 4px;
}

.google-btn {
  width: 100%;
  height: 43px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: white;
  color: var(--text);

  font-size: .84rem;
  font-weight: 600;

  cursor: pointer;

  transition: .2s ease;
}

.google-btn:hover {
  border-color: #ccd1dc;
  background: #fafbfc;
}

.google-icon {
  font-size: .95rem;
  font-weight: 700;
  color: #4285f4;
}

.text-btn {
  background: none;
  color: var(--blue);

  font-size: .82rem;
  font-weight: 600;

  cursor: pointer;

  padding: 4px;
}

.text-btn:hover {
  text-decoration: underline;
}

.secondary-btn {
  min-height: 42px;

  padding: 0 17px;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: white;

  color: var(--text);

  font-size: .82rem;
  font-weight: 600;

  cursor: pointer;

  transition: .2s ease;
}

.secondary-btn:hover {
  background: #f7f8fa;
}

.danger-btn {
  min-height: 42px;

  padding: 0 17px;

  border-radius: 8px;

  background: var(--danger-light);
  color: var(--danger);

  font-size: .82rem;
  font-weight: 600;

  cursor: pointer;
}


/* =========================
   AUTH DIVIDER
========================= */

.divider {
  display: flex;
  align-items: center;
  gap: 12px;

  color: var(--text-muted);

  font-size: .72rem;
}

.divider::before,
.divider::after {
  content: "";

  height: 1px;
  flex: 1;

  background: var(--border);
}


/* =========================
   AUTH FOOTER
========================= */

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 6px;

  margin-top: 32px;

  color: var(--text-muted);

  font-size: .67rem;
}


/* =========================
   APP SHELL
========================= */

.app-shell {
  min-height: 100vh;

  display: flex;
    opacity: 1;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
  width: 245px;
  min-width: 245px;

  min-height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  padding: 25px 16px 17px;

  background: var(--navy);

  color: white;
}

.sidebar-brand {
  padding: 0 9px;

  color: white;

  margin-bottom: 42px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  padding: 0 12px;
  margin-bottom: 8px;

  color: #647086;

  font-size: .63rem;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .12em;
}

.second-section {
  margin-top: 30px;
}

.nav-item {
  width: 100%;

  height: 43px;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 0 12px;

  border-radius: 8px;

  background: transparent;

  color: #9aa5b8;

  font-size: .81rem;
  font-weight: 500;

  text-align: left;

  cursor: pointer;

  transition: .2s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,.05);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,.09);
  color: white;
}

.nav-icon {
  width: 20px;

  color: #8490a4;

  font-size: 1rem;

  text-align: center;
}

.nav-item.active .nav-icon {
  color: #d5b875;
}


/* =========================
   SIDEBAR BOTTOM
========================= */

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.upgrade-card {
  padding: 17px;

  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.055),
      rgba(255,255,255,.025)
    );
}

.upgrade-label {
  display: block;

  margin-bottom: 10px;

  color: #c8a96b;

  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.upgrade-card strong {
  display: block;

  color: white;

  font-size: .82rem;
  line-height: 1.45;
}

.upgrade-card p {
  margin-top: 7px;

  color: #7f899c;

  font-size: .67rem;
  line-height: 1.5;
}

.logout-btn {
  width: 100%;

  display: flex;
  align-items: center;
  gap: 11px;

  padding: 9px 12px;

  background: none;

  color: #818c9f;

  font-size: .78rem;

  cursor: pointer;

  border-radius: 7px;

  text-align: left;

  transition: .2s ease;
}

.logout-btn:hover {
  color: white;
  background: rgba(255,255,255,.05);
}


/* =========================
   MAIN
========================= */

.main-content {
  flex: 1;
  min-width: 0;
}


/* =========================
   TOPBAR
========================= */

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  background: white;
  border-bottom: 1px solid var(--border);
}
.topbar-spacer {
  flex: 1;
}

.notification-btn {
  width: 37px;
  height: 37px;

  margin-right: 22px;

  position: relative;

  border-radius: 8px;

  background: transparent;

  color: #7d8696;

  cursor: pointer;

  font-size: 1.25rem;
}

.notification-btn:hover {
  background: #f5f6f9;
}

.notification-btn i {
  position: absolute;

  top: 7px;
  right: 8px;

  width: 5px;
  height: 5px;

  border-radius: 50%;

  background: var(--blue);

  border: 1px solid white;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;

  padding-left: 18px;

  border-left: 1px solid var(--border);
}

.avatar {
  width: 35px;
  height: 35px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--gold-light);

  color: #96743a;

  font-size: .75rem;
  font-weight: 700;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-info strong {
  color: var(--text);

  font-size: .75rem;
  font-weight: 600;
}

.user-info span {
  color: var(--text-muted);

  font-size: .63rem;
}

.profile-arrow {
  margin-left: 6px;

  color: var(--text-muted);
}


/* =========================
   DASHBOARD
========================= */

.dashboard {
  max-width: 1250px;

  margin: 0 auto;

  padding: 45px 42px 60px;
}

.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 25px;

  margin-bottom: 30px;
}

.welcome-row h1 {
  margin: 8px 0 6px;

  color: var(--navy);

  font-family: "Playfair Display", serif;

  font-size: 2rem;
  letter-spacing: -.03em;
}

.welcome-row p {
  color: var(--text-soft);

  font-size: .83rem;
}

.new-task-btn {
  white-space: nowrap;
}


/* =========================
   STATS
========================= */

.stats-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 17px;

  margin-bottom: 40px;
}

.stat-card {
  min-height: 150px;

  padding: 22px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 12px;

  box-shadow: 0 3px 12px rgba(16,24,39,.025);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 17px;
}

.stat-label {
  color: var(--text-soft);

  font-size: .73rem;
  font-weight: 600;
}

.stat-icon {
  width: 31px;
  height: 31px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  font-size: .85rem;
}

.stat-icon.blue {
  background: var(--blue-light);
  color: var(--blue);
}

.stat-icon.gold {
  background: var(--gold-light);
  color: #9d7a3c;
}

.stat-icon.green {
  background: var(--green-light);
  color: var(--green);
}

.stat-number {
  display: block;

  color: var(--navy);

  font-family: "Playfair Display", serif;

  font-size: 2rem;
  line-height: 1;

  margin-bottom: 9px;
}

.stat-description {
  color: var(--text-muted);

  font-size: .66rem;
}


/* =========================
   TASK SECTION
========================= */
.task-form-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.task-form-body .input-group:last-child {
  grid-column: 1 / -1;
}

.form-control {
  min-height: 43px;
}

select.form-control {
  cursor: pointer;
}

.task-priority {
  display: inline-flex;

  padding: 4px 8px;

  margin-bottom: 7px;

  border-radius: 5px;

  font-size: .62rem;
  font-weight: 700;
}

.task-priority.high {
  background: var(--danger-light);
  color: var(--danger);
}

.task-priority.medium {
  background: var(--gold-light);
  color: #96743a;
}

.task-priority.low {
  background: var(--green-light);
  color: var(--green);
}

.task h3 {
  margin: 0;

  color: var(--navy);

  font-size: .95rem;
  font-weight: 600;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-top: 12px;
}

.task-meta span {
  padding: 5px 8px;

  border-radius: 5px;

  background: #f5f6f9;

  color: var(--text-soft);

  font-size: .65rem;
}

.task-meta strong {
  color: var(--text);
}

.task-description {
  margin-top: 12px !important;

  color: var(--text-soft);

  font-size: .72rem !important;
}
.tasks-section {
  width: 100%;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  margin-bottom: 16px;
}

.section-header h2 {
  margin-top: 6px;

  color: var(--navy);

  font-family: "Playfair Display", serif;

  font-size: 1.45rem;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 8px 12px;

  border: 1px solid var(--border);
  border-radius: 7px;

  background: white;

  color: var(--text-soft);

  font-size: .7rem;
  font-weight: 600;

  cursor: pointer;
}


/* =========================
   TODO APP
========================= */

.todo-app {
  width: 100%;

  min-height: 200px;

  background: transparent;
}


/* =========================
   TASKS
========================= */

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.task {
  position: relative;

  padding: 19px 20px 19px 23px;

  background: white;

  border: 1px solid var(--border);
  border-radius: 10px;

  box-shadow: 0 2px 7px rgba(16,24,39,.025);

  transition:
    transform .18s ease,
    box-shadow .18s ease;
}

.task::before {
  content: "";

  position: absolute;

  top: 18px;
  left: 0;

  width: 3px;
  height: calc(100% - 36px);

  border-radius: 0 4px 4px 0;

  background: var(--blue);
}

.task:hover {
  transform: translateY(-1px);

  box-shadow: var(--shadow);
}

.task p {
  margin-bottom: 6px;

  color: var(--text-soft);

  font-size: .75rem;

  line-height: 1.5;
}

.task p:first-child {
  color: var(--navy);

  font-size: .87rem;
}

.task strong {
  font-weight: 600;
}

.task p:first-child strong {
  color: inherit;
}


/* Task buttons */

.task .btn {
  min-height: 30px;

  padding: 0 11px;

  margin: 8px 5px 0 0;

  border-radius: 6px;

  font-size: .68rem;
  font-weight: 600;

  cursor: pointer;
}

.task .edit-btn {
  background: var(--blue-light);
  color: var(--blue);
}

.task .edit-btn:hover {
  background: #e2e8ff;
}

.task .delete-btn {
  background: var(--danger-light);
  color: var(--danger);
}

.task .delete-btn:hover {
  background: #ffe5e5;
}


/* =========================
   EMPTY STATE
========================= */

.empty-state {
  padding: 60px 20px;

  text-align: center;

  border: 1px dashed var(--border);
  border-radius: 12px;

  background: white;
}

.empty-icon {
  width: 46px;
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0 auto 15px;

  border-radius: 50%;

  background: var(--blue-light);
  color: var(--blue);

  font-size: 1.2rem;
}

.empty-state h3 {
  margin-bottom: 7px;

  color: var(--navy);

  font-family: "Playfair Display", serif;
}

.empty-state p {
  max-width: 350px;

  margin: 0 auto 20px;

  color: var(--text-muted);

  font-size: .75rem;
  line-height: 1.6;
}


/* =========================
   TASK MODAL
========================= */
/* =========================
   TASK FORM
========================= */

.task-form {
  position: fixed;

  top: 50%;
  left: 50%;

  width: min(850px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);

  transform: translate(-50%, -50%);

  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;

  background: white;

  border: 1px solid var(--border);
  border-radius: 16px;

  box-shadow: var(--shadow-lg);

  overflow: hidden;

  z-index: 1000;

  animation: modalIn .2s ease;
}

.task-form.hidden {
  display: none !important;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(.98);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}


/* HEADER */

.task-form-header {
  grid-column: 1 / -1;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  padding: 25px 27px 20px;

  border-bottom: 1px solid var(--border);
}

.task-form-header h2 {
  margin-top: 5px;

  color: var(--navy);

  font-family: "Playfair Display", serif;

  font-size: 1.35rem;
}


/* BODY */

.task-form-body {
  grid-column: 1 / -1;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;

  padding: 25px 27px;

  overflow-y: auto;
}


/* DESCRIPCIÓN OCUPA TODO */

.task-form-body .input-group:last-child {
  grid-column: 1 / -1;
}


/* FOOTER */

.task-form-footer {
  grid-column: 1 / -1;

  display: flex;
  justify-content: flex-end;
  gap: 9px;

  padding: 17px 27px;

  background: #fafbfc;

  border-top: 1px solid var(--border);
}


/* CERRAR */

.close-task-form-btn {
  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 7px;

  background: transparent;

  color: var(--text-muted);

  font-size: 1.45rem;

  cursor: pointer;
}

.close-task-form-btn:hover {
  background: #f3f4f7;
  color: var(--text);
}

/* =========================
   DIALOG
========================= */

#confirm-close-dialog {
  width: min(400px, calc(100% - 30px));

  border: 1px solid var(--border);
  border-radius: 13px;

  padding: 0;

  box-shadow: var(--shadow-lg);

  color: var(--text);
}

#confirm-close-dialog::backdrop {
  background: rgba(12,18,30,.48);
  backdrop-filter: blur(3px);
}

.dialog-content {
  padding: 28px;
}

.dialog-icon {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 17px;

  border-radius: 50%;

  background: var(--gold-light);

  color: #98783f;

  font-weight: 700;
}

.dialog-content h3 {
  margin-bottom: 7px;

  color: var(--navy);

  font-family: "Playfair Display", serif;
}

.dialog-content p {
  color: var(--text-soft);

  font-size: .75rem;
  line-height: 1.5;
}

.confirm-close-dialog-btn-container {
  display: flex;
  justify-content: flex-end;
  gap: 8px;

  margin-top: 25px;
}


/* =========================
   MOBILE
========================= */

.mobile-brand {
  display: none;
}

@media (max-width: 900px) {

  .sidebar {
    width: 205px;
    min-width: 205px;
  }

  .dashboard {
    padding: 35px 25px 50px;
  }

  .topbar {
    padding: 0 25px;
  }

}


@media (max-width: 700px) {


  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;

    color: var(--navy);

    font-size: .95rem;
    font-weight: 700;
  }

  .mobile-brand .brand-mark {
    width: 30px;
    height: 30px;

    font-size: 1.05rem;
  }

  .topbar {
    height: 62px;
    padding: 0 18px;
  }

  .user-info,
  .profile-arrow {
    display: none;
  }

  .user-profile {
    padding-left: 12px;
  }

  .notification-btn {
    margin-right: 10px;
  }

  .dashboard {
    padding: 30px 17px 45px;
  }

  .welcome-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-row h1 {
    font-size: 1.7rem;
  }

  .new-task-btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;

    gap: 10px;
  }

  .stat-card {
    min-height: 125px;
  }

}


@media (max-width: 480px) {

  .auth-page {
    padding: 15px;
  }

  .auth-card {
    padding: 30px 23px;
    border-radius: 14px;
  }

  .auth-brand {
    margin-bottom: 35px;
  }

  .auth-heading h1 {
    font-size: 1.7rem;
  }

  .section-header {
    align-items: center;
  }

  .section-header h2 {
    font-size: 1.25rem;
  }

  .task {
    padding: 17px 15px 17px 19px;
  }

  .task-form-header,
  .task-form-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .task-form-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .confirm-close-dialog-btn-container {
    flex-direction: column;
  }

  .confirm-close-dialog-btn-container button {
    width: 100%;
  }

}
/* DEBUG - eliminar después */
#task-form.hidden {
  display: none !important;
}

#confirm-close-dialog {
  display: none;
}


#confirm-close-dialog[open] {
  display: block;
}
body {
  filter: none !important;
}

main,
#app-container,
.todo-app,
#tasks-container,
.task {
  filter: none !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  transform: none;
}
@media (max-width: 700px) {

  .task-form {
    width: calc(100vw - 30px);
    max-height: calc(100vh - 30px);

    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;

    border-radius: 14px;

    overflow-y: auto;
  }

  .task-form-header {
    grid-column: 1;
  }

  .task-form-body {
    grid-column: 1;
  }

  .task-form-footer {
    grid-column: 1;
  }
  .task-form-body {
  grid-template-columns: 1fr;
}

.task-form-body .input-group:last-child {
  grid-column: 1;
}

.task-meta {
  flex-direction: column;
  align-items: flex-start;
}

}
.task.completed {
  opacity: .65;
}

.task.completed::before {
  background: var(--green);
}

.task.completed h3 {
  text-decoration: line-through;
  color: var(--text-muted);
}

.complete-btn {
  background: var(--green-light);
  color: var(--green);
}

.complete-btn:hover {
  background: #dff3e9;
}

.reopen-btn {
  background: var(--blue-light);
  color: var(--blue);
}

.reopen-btn:hover {
  background: #e2e8ff;
}
.task.completed {
  opacity: 0.65;
}

.task.completed h3 {
  text-decoration: line-through;
}

.task.completed::before {
  background: var(--green);
}.task-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
}

.stat-card strong {
  font-size: 28px;
  color: #111827;
}

@media (max-width: 800px) {
  .task-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .task-stats {
    grid-template-columns: 1fr;
  }
}.filter-wrapper {
  position: relative;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.filter-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
  z-index: 20;
}

.filter-option {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.filter-option:hover {
  background: #f3f4f6;
}

.filter-option.active {
  background: #f0f4ff;
  font-weight: 600;
}

.hidden {
  display: none !important;
}
/* ========================================
   EXPEDIENTES
======================================== */

.page-section {
  padding: 40px 48px;
  min-height: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 32px;
}

.page-header h1 {
  margin: 6px 0;
}

.page-header p {
  margin: 0;
  color: #777;
}


/* BUSCADOR */

.cases-toolbar {
  margin-bottom: 28px;
}

.case-search {
  display: flex;
  align-items: center;
  gap: 10px;

  max-width: 500px;

  padding: 12px 16px;

  background: white;

  border: 1px solid #e5e5e5;

  border-radius: 10px;
}

.case-search input {
  width: 100%;

  border: none;

  outline: none;

  font-family: inherit;

  font-size: 14px;
}


/* GRID */

.cases-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(300px, 1fr)
    );

  gap: 20px;
}


/* CARD */

.case-card {

  background: white;

  border: 1px solid #e8e8e8;

  border-radius: 14px;

  padding: 22px;

  transition:
    transform .2s,
    box-shadow .2s;

}

.case-card:hover {

  transform: translateY(-2px);

  box-shadow:
    0 8px 25px
    rgba(0,0,0,.06);

}


.case-card-top {

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 18px;

}


.case-type {

  font-size: 12px;

  font-weight: 600;

  text-transform: uppercase;

  letter-spacing: .05em;

  color: #777;

}


.case-status {

  padding: 5px 9px;

  border-radius: 20px;

  font-size: 11px;

  font-weight: 600;

}


.case-status.active {

  background: #e9f7ef;

  color: #198754;

}


.case-status.pending {

  background: #fff5d9;

  color: #9a7000;

}


.case-status.closed {

  background: #eeeeee;

  color: #666;

}


.case-card h3 {

  margin: 0 0 6px;

  font-size: 20px;

}


.case-client {

  margin: 0;

  color: #555;

  font-size: 15px;

}


.case-card-meta {

  margin-top: 20px;

  padding-top: 16px;

  border-top: 1px solid #eee;

  color: #777;

  font-size: 13px;

}


.case-card-actions {

  display: flex;

  gap: 8px;

  margin-top: 18px;

}


.case-card-actions button {

  flex: 1;

  font-size: 12px;

  padding: 9px 10px;

}


#case-form {

  position: fixed;

  z-index: 1000;

  top: 50%;

  left: 50%;

  transform:
    translate(-50%, -50%);

  width: min(
    520px,
    calc(100% - 30px)
  );

  max-height: 90vh;

  overflow-y: auto;

  background: white;

  border-radius: 16px;

  box-shadow:
    0 25px 80px
    rgba(0,0,0,.2);

}


@media (max-width: 700px) {

  .page-section {
    padding: 25px 18px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cases-grid {
    grid-template-columns: 1fr;
  }

}
/* ========================================
   CLIENTES
======================================== */

#clientes-page {
  padding: 30px;
  width: 100%;
}

#clientes-page .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

#clientes-page .page-header h1 {
  margin: 0 0 6px;
}

#clientes-page .page-header p {
  margin: 0;
  color: #777;
}


/* BUSCADOR */

#client-search-input {
  width: 100%;
  max-width: 500px;
  padding: 13px 16px;
  margin-bottom: 25px;

  border: 1px solid #ddd;
  border-radius: 10px;

  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}

#client-search-input:focus {
  border-color: #555;
}


/* CONTENEDOR */

#clients-container {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(280px, 1fr)
  );
  gap: 18px;
}


/* TARJETA */

.client-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;

  padding: 20px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  min-height: 180px;

  box-sizing: border-box;
}

.client-card-info h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.client-card-info p {
  margin: 6px 0;
  color: #666;
  font-size: 14px;
}


/* ACCIONES */

.client-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.client-card-actions button {
  flex: 1;
}


/* ESTADO VACÍO */

#clients-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #777;
}

#clients-empty-state h3 {
  margin-bottom: 8px;
  color: #333;
}

#clients-empty-state p {
  margin-bottom: 20px;
}


/* FORMULARIO */

#client-form {
  position: fixed;

  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%);

  width: min(500px, calc(100% - 40px));

  background: #fff;

  padding: 28px;

  border-radius: 16px;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.2);

  z-index: 1000;

  box-sizing: border-box;
}

#client-form h2 {
  margin-top: 0;
  margin-bottom: 22px;
}

#client-form input,
#client-form textarea {
  width: 100%;

  padding: 13px 14px;

  margin-bottom: 12px;

  border: 1px solid #ddd;
  border-radius: 9px;

  font-family: inherit;
  font-size: 14px;

  box-sizing: border-box;

  outline: none;
}

#client-form textarea {
  min-height: 100px;
  resize: vertical;
}

#client-form input:focus,
#client-form textarea:focus {
  border-color: #555;
}

#client-form button {
  padding: 12px 16px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
}

#save-client-btn {
  margin-right: 8px;
}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 759px) {

  #clientes-page {
    padding: 20px;
  }

  #clientes-page .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #clients-container {
    grid-template-columns: 1fr;
  }

  .client-card {
    min-height: auto;
  }

  #client-form {
    padding: 22px;
  }

}
/* =========================
   CALENDARIO
========================== */

.calendar-container {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  padding: 24px;
  margin-top: 24px;
}

.calendar-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 25px;
}

.calendar-top h2 {
  min-width: 180px;
  text-align: center;
  margin: 0;
  font-size: 21px;
}

.calendar-arrow {
  width: 40px;
  height: 40px;
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  transition: 0.2s;
}

.calendar-arrow:hover {
  background: #f5f5f5;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.calendar-weekdays div {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #777;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day {
  min-height: 110px;
  border: 1px solid #eeeeee;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  transition: 0.15s;
}

.calendar-day:hover {
  background: #fafafa;
}

.calendar-day.empty {
  background: #fafafa;
  border-color: transparent;
}

.calendar-day.today {
  border: 2px solid #1d4ed8;
}

.calendar-day-number {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 7px;
}

.calendar-task {
  background: #eef4ff;
  color: #2457c5;
  border-radius: 6px;
  padding: 6px 7px;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calendar-task:hover {
  background: #e1ebff;
}

.calendar-task.high {
  background: #fff0f0;
  color: #c53030;
}

.calendar-task.medium {
  background: #fff8e7;
  color: #9a6700;
}

.calendar-task.low {
  background: #eef9f1;
  color: #2f7d46;
}


/* RESPONSIVE */

@media (max-width: 700px) {

  .calendar-container {
    padding: 12px;
  }

  .calendar-day {
    min-height: 75px;
    padding: 6px;
  }

  .calendar-weekdays div {
    font-size: 11px;
  }

  .calendar-task {
    font-size: 10px;
    padding: 4px;
  }

}

.deadline-disclaimer {
  margin-top: 16px;
  padding: 14px 16px;
  border: 2px solid rgb(199, 139, 28);
  border-radius: 10px;
  background: rgba(180, 130, 40, 0.06);
}

.deadline-disclaimer strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}

.deadline-disclaimer p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.5;
  opacity: 1;
}
.alerts-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: white;
}

.alert-item-icon {
  font-size: 20px;
}

.alert-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.alert-item-content strong {
  font-size: 15px;
}

.alert-item-content span {
  font-size: 12px;
  font-weight: 700;
}

.alert-item-content small {
  font-size: 12px;
  opacity: 0.7;
}

.alert-open-btn {
  white-space: nowrap;
}

.alert-highlight {
  animation: alertHighlight 2s ease;
}

@keyframes alertHighlight {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 700px) {

  .alerts-summary {
    grid-template-columns: 1fr;
  }

  .alert-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .alert-open-btn {
    width: 100%;
  }

}
/* ========================================
   PLAZOS PROCESALES
======================================== */

.task-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.task-type-badge.procedural {
  background: #eef2ff;
  color: #3730a3;
}

.task-type-badge.fatal {
  background: #fef2f2;
  color: #b91c1c;
}

.task-deadline-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.task-deadline-status.alert-upcoming {
  background: #fff7ed;
  color: #c2410c;
}

.task-deadline-status.alert-tomorrow {
  background: #fef3c7;
  color: #92400e;
}

.task-deadline-status.alert-today {
  background: #fee2e2;
  color: #b91c1c;
}

.task-deadline-status.alert-overdue {
  background: #450a0a;
  color: #ffffff;
}

.task-deadline-status.alert-fatal {
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.15);
}


/* ========================================
   ALERTAS
======================================== */

.alert-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.alert-item-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f3f4f6;
  font-size: 20px;
  flex-shrink: 0;
}

.alert-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.alert-item-content strong {
  font-size: 15px;
}

.alert-item-content span {
  font-weight: 700;
  font-size: 13px;
}

.alert-item-content small {
  color: #6b7280;
}

.alert-item.alert-today,
.alert-item.alert-fatal {
  border-color: #fecaca;
}

.alert-item.alert-overdue {
  border-color: #fca5a5;
}

.alert-item.alert-fatal {
  border-left: 4px solid #b91c1c;
}

.alert-highlight {
  animation: alertTaskHighlight 2.5s ease;
}

@keyframes alertTaskHighlight {

  0% {
    transform: scale(1);
  }

  20% {
    transform: scale(1.015);
  }

  100% {
    transform: scale(1);
  }

}
/* ========================================
   DETALLE DE TAREA
======================================== */

.task-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.task-detail-modal.hidden {
  display: none;
}

.task-detail-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.task-detail-card {
  position: relative;
  z-index: 2;

  width: min(720px, 100%);
  max-height: 90vh;

  overflow-y: auto;

  background: var(--bg-card, #ffffff);
  border-radius: 18px;

  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.20);
}

.task-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  padding: 26px 28px 20px;

  border-bottom: 1px solid
    var(--border-color, #e5e7eb);
}

.task-detail-header h2 {
  margin: 6px 0 0;
  font-size: 25px;
}

.task-detail-body {
  padding: 26px 28px;
}

.task-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-bottom: 24px;
}

.task-detail-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 14px;
}

.task-detail-item {
  padding: 15px;

  border-radius: 12px;

  background:
    var(--bg-secondary, #f7f7f8);

  border: 1px solid
    var(--border-color, #e5e7eb);
}

.task-detail-item span {
  display: block;

  margin-bottom: 6px;

  font-size: 12px;
  font-weight: 600;

  text-transform: uppercase;
  letter-spacing: .04em;

  opacity: .65;
}

.task-detail-item strong {
  display: block;

  font-size: 15px;
}

.task-detail-procedural {
  margin-top: 24px;

  padding: 20px;

  border-radius: 14px;

  border: 1px solid
    var(--border-color, #e5e7eb);
}

.task-detail-section-title {
  display: block;

  margin-bottom: 14px;

  font-weight: 700;
}

.task-detail-fatal {
  margin-top: 16px;

  padding: 12px 14px;

  border-radius: 10px;

  font-weight: 700;
}

.task-detail-disclaimer {
  margin-top: 14px;

  font-size: 12px;
  line-height: 1.5;

  opacity: .7;
}

.task-detail-description-section {
  margin-top: 26px;
}

.task-detail-description-section p {
  margin: 10px 0 0;

  line-height: 1.6;

  white-space: pre-wrap;
}

.task-detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  padding: 20px 28px;

  border-top: 1px solid
    var(--border-color, #e5e7eb);
}

@media (max-width: 600px) {

  .task-detail-modal {
    padding: 12px;
  }

  .task-detail-card {
    max-height: 94vh;
    border-radius: 14px;
  }

  .task-detail-grid {
    grid-template-columns: 1fr;
  }

  .task-detail-footer {
    flex-direction: column;
  }

  .task-detail-footer button {
    width: 100%;
  }

}
/* ========================================
   CONFIGURACIÓN
======================================== */

.settings-container {
  width: min(900px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  padding: 24px;
}

.settings-card-header {
  margin-bottom: 22px;
}

.settings-card-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.settings-card-header p {
  margin: 0;
  font-size: 14px;
  opacity: .65;
}

.settings-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-option label {
  font-weight: 600;
}

.settings-option select {
  width: 220px;
}

.settings-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-connection strong {
  display: block;
  margin-bottom: 5px;
}

.settings-connection p {
  margin: 0;
  font-size: 14px;
  opacity: .65;
}

.settings-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-account-field span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  opacity: .6;
}

.settings-account-field strong {
  font-size: 15px;
}

.settings-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.settings-links a:hover {
  text-decoration: underline;
}

.danger-btn {
  border: 1px solid #dc2626;
  background: transparent;
  color: #dc2626;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
}

@media (max-width: 650px) {

  .settings-option,
  .settings-connection,
  .settings-account {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-option select {
    width: 100%;
  }

}
/* =========================================================
   LETRIVA — PREMIUM DARK MODE
========================================================= */

:root {
  --background: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafbfc;

  --border: #e6e8ed;

  --text: #172033;
  --text-soft: #687186;
  --text-muted: #98a0ae;

  --blue-light: #eef2ff;
  --gold-light: #f5eddf;
  --green-light: #edf7f1;
  --danger-light: #fff1f1;

  --shadow: 0 8px 28px rgba(16, 24, 39, .05);
  --shadow-lg: 0 20px 60px rgba(16, 24, 39, .14);
}


/* =========================================================
   DARK THEME
========================================================= */

html[data-theme="dark"] {

  --background: #0c1016;

  color:black;
  --surface: #141920;

  --surface-soft: #191f27;

  --border: #252c35;

  --text: #edf0f4;

  --text-soft: #a3acba;

  --text-muted: #727c8b;

  --blue-light: #182238;

  --gold-light: #282318;

  --green-light: #17271f;

  --danger-light: #321d20;

  --shadow:
    0 10px 30px rgba(0, 0, 0, .22);

  --shadow-lg:
    0 25px 70px rgba(0, 0, 0, .42);
}


/* =========================================================
   GLOBAL THEME
========================================================= */

body {
  background: var(--background);
  color: var(--text);
}

html[data-theme="dark"] body {
  background: #0c1016;
  color: var(--text);
}

.main-content {
  background: var(--background);
}


/* =========================================================
   TOPBAR
========================================================= */

html[data-theme="dark"] .topbar {

  background: #11161d;

  border-bottom: 1px solid #252c35;

}

html[data-theme="dark"] .notification-btn {

  color: #8d97a5;

}

html[data-theme="dark"] .notification-btn:hover {

  background: #191f27;

}

html[data-theme="dark"] .user-profile {

  border-left-color: #252c35;

}

html[data-theme="dark"] .user-info strong {

  color: var(--text);

}

html[data-theme="dark"] .user-info span {

  color: var(--text-muted);

}


/* =========================================================
   SIDEBAR
========================================================= */

html[data-theme="dark"] .sidebar {

  background: #090d12;

  border-right: 1px solid #1b222b;

}

html[data-theme="dark"] .nav-item {

  color: #8f99a8;

}

html[data-theme="dark"] .nav-item:hover {

  background: #151b23;

  color: #e9edf2;

}

html[data-theme="dark"] .nav-item.active {

  background: #171d25;

  color: #f1f3f6;

}

html[data-theme="dark"] .nav-item.active .nav-icon {

  color: #d4b979;

}

html[data-theme="dark"] .nav-section-title {

  color: #596373;

}


/* =========================================================
   MAIN HEADINGS
========================================================= */

html[data-theme="dark"] .welcome-row h1,
html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .section-header h2,
html[data-theme="dark"] .task h3,
html[data-theme="dark"] .stat-number {

  color: var(--text);

}

html[data-theme="dark"] .welcome-row p,
html[data-theme="dark"] .page-header p {

  color: var(--text-soft);

}


/* =========================================================
   STAT CARDS
========================================================= */

html[data-theme="dark"] .stat-card {

  background: #141920;

  border-color: #252c35;

  box-shadow: none;

}

html[data-theme="dark"] .stat-card:hover {

  border-color: #303945;

}

html[data-theme="dark"] .stat-label {

  color: #8f99a8;

}

html[data-theme="dark"] .stat-description {

  color: #697482;

}


/* =========================================================
   TASKS
========================================================= */

html[data-theme="dark"] .tasks-section {

  background: transparent;

}

html[data-theme="dark"] .task {

  background: #141920;

  border-color: #252c35;

  box-shadow: none;

}

html[data-theme="dark"] .task:hover {

  background: #171d24;

  border-color: #303945;

  box-shadow:
    0 10px 30px rgba(0,0,0,.18);

}

html[data-theme="dark"] .task p {

  color: #969fad;

}

html[data-theme="dark"] .task p:first-child {

  color: var(--text);

}

html[data-theme="dark"] .task-meta span {

  background: #1a2028;

  color: #929baa;

}

html[data-theme="dark"] .task-meta strong {

  color: #dce1e7;

}


/* =========================================================
   TASK PRIORITIES
   Muy sutiles
========================================================= */

html[data-theme="dark"] .task-priority.high {

  background: #2c1d20;

  color: #d98b94;

}

html[data-theme="dark"] .task-priority.medium {

  background: #2a261c;

  color: #ccb878;

}

html[data-theme="dark"] .task-priority.low {

  background: #19251f;

  color: #87b59a;

}


/* =========================================================
   ACTION BUTTONS
========================================================= */

html[data-theme="dark"] .task .edit-btn {

  background: #19233b;

  color: #91a5ec;

}

html[data-theme="dark"] .task .delete-btn {

  background: #2b1c1f;

  color: #db8c94;

}

html[data-theme="dark"] .complete-btn {

  background: #19251f;

  color: #8abd9e;

}

html[data-theme="dark"] .reopen-btn {

  background: #19233b;

  color: #91a5ec;

}


/* =========================================================
   SECONDARY BUTTONS
========================================================= */

html[data-theme="dark"] .secondary-btn {

  background: #171d24;

  border-color: #2a323d;

  color: #dce1e7;

}

html[data-theme="dark"] .secondary-btn:hover {

  background: #1e252e;

}


/* =========================================================
   INPUTS
========================================================= */

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .input-group input,
html[data-theme="dark"] textarea {

  background: #171d24;

  border-color: #29313c;

  color: #edf0f4;

}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .input-group input:focus,
html[data-theme="dark"] textarea:focus {

  background: #1a2129;

  border-color: #5268c9;

  box-shadow:
    0 0 0 3px rgba(82,104,201,.12);

}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .input-group input::placeholder,
html[data-theme="dark"] textarea::placeholder {

  color: #687280;

}


/* =========================================================
   FILTER
========================================================= */

html[data-theme="dark"] .filter-btn {

  background: #171d24;

  border-color: #29313c;

  color: #a0a9b7;

}

html[data-theme="dark"] .filter-menu {

  background: #151b22;

  border-color: #29313c;

  box-shadow:
    0 18px 50px rgba(0,0,0,.38);

}

html[data-theme="dark"] .filter-option {

  color: #9ea7b5;

}

html[data-theme="dark"] .filter-option:hover {

  background: #1d242d;

  color: #eef1f4;

}

html[data-theme="dark"] .filter-option.active {

  background: #1b2740;

  color: #9dafff;

}


/* =========================================================
   EMPTY STATES
========================================================= */

html[data-theme="dark"] .empty-state {

  background: #12181f;

  border-color: #29313c;

}

html[data-theme="dark"] .empty-state h3 {

  color: var(--text);

}

html[data-theme="dark"] .empty-state p {

  color: #7c8695;

}


/* =========================================================
   EXPEDIENTES
========================================================= */

html[data-theme="dark"] .case-card {

  background: #141920;

  border-color: #252c35;

  box-shadow: none;

}

html[data-theme="dark"] .case-card:hover {

  background: #171d24;

  border-color: #303945;

  box-shadow:
    0 12px 30px rgba(0,0,0,.18);

}

html[data-theme="dark"] .case-card h3 {

  color: var(--text);

}

html[data-theme="dark"] .case-client {

  color: #939ca9;

}

html[data-theme="dark"] .case-card-meta {

  border-color: #252c35;

  color: #737d8b;

}

html[data-theme="dark"] .case-type {

  color: #7c8694;

}


/* =========================================================
   CLIENTES
========================================================= */

html[data-theme="dark"] #clientes-page {

  background: transparent;

  color: var(--text);

}

html[data-theme="dark"] #clientes-page .page-header h1 {

  color: var(--text);

}

html[data-theme="dark"] #clientes-page .page-header p {

  color: var(--text-soft);

}

html[data-theme="dark"] #clientes-page input {

  background: #171d24;

  color: var(--text);

  border-color: #29313c;

}

html[data-theme="dark"] #clientes-page input::placeholder {

  color: #687280;

}

html[data-theme="dark"] #clientes-page .client-card {

  background: #141920;

  border-color: #252c35;

  box-shadow: none;

}

html[data-theme="dark"] #clientes-page .client-card:hover {

  background: #171d24;

  border-color: #303945;

}

html[data-theme="dark"] #clientes-page .client-card-info h3 {

  color: var(--text);

}

html[data-theme="dark"] #clientes-page .client-card-info p {

  color: #9099a7;

}


/* =========================================================
   FORMULARIO CLIENTE
========================================================= */

html[data-theme="dark"] #client-form {

  background: #141920;

  border: 1px solid #29313c;

  box-shadow:
    0 25px 70px rgba(0,0,0,.45);

}

html[data-theme="dark"] #client-form h2 {

  color: var(--text);

}

html[data-theme="dark"] #client-form input,
html[data-theme="dark"] #client-form textarea {

  background: #171d24;

  color: var(--text);

  border-color: #29313c;

}

html[data-theme="dark"] #client-form input::placeholder,
html[data-theme="dark"] #client-form textarea::placeholder {

  color: #687280;

}


/* =========================================================
   ALERTAS
========================================================= */

html[data-theme="dark"] #alertas-page {

  color: var(--text);

}

html[data-theme="dark"] #alertas-page .page-header h1 {

  color: var(--text);

}

html[data-theme="dark"] #alertas-page .page-header p {

  color: var(--text-soft);

}

html[data-theme="dark"] .alert-item {

  background: #141920;

  border-color: #252c35;

  box-shadow: none;

}

html[data-theme="dark"] .alert-item:hover {

  background: #171d24;

}

html[data-theme="dark"] .alert-item-icon {

  background: #1a2028;

  color: #a5adba;

}

html[data-theme="dark"] .alert-item-content strong {

  color: var(--text);

}

html[data-theme="dark"] .alert-item-content small {

  color: #737e8c;

}


/* Alertas críticas */

html[data-theme="dark"] .alert-item.alert-today,
html[data-theme="dark"] .alert-item.alert-fatal {

  border-color: #5a3035;

}

html[data-theme="dark"] .alert-item.alert-fatal {

  border-left-color: #b85d66;

}


/* Alerta vencida */

html[data-theme="dark"] .alert-item.alert-overdue {

  border-color: #633239;

}


/* =========================================================
   CALENDARIO
========================================================= */

html[data-theme="dark"] .calendar-container {

  background: #141920;

  border-color: #252c35;

}

html[data-theme="dark"] .calendar-top h2 {

  color: var(--text);

}

html[data-theme="dark"] .calendar-arrow {

  background: #171d24;

  border-color: #29313c;

  color: #d9dee5;

}

html[data-theme="dark"] .calendar-arrow:hover {

  background: #1e252e;

}

html[data-theme="dark"] .calendar-weekdays {

  border-color: #252c35;

}

html[data-theme="dark"] .calendar-weekdays div {

  color: #707b89;

}

html[data-theme="dark"] .calendar-day {

  background: #12181f;

  border-color: #252c35;

  color: var(--text);

}

html[data-theme="dark"] .calendar-day:hover {

  background: #171d24;

}

html[data-theme="dark"] .calendar-day.empty {

  background: #0f141a;

}

html[data-theme="dark"] .calendar-day.today {

  border-color: #566bc7;

}


/* Eventos del calendario */

html[data-theme="dark"] .calendar-task {

  background: #1a2740;

  color: #9caeff;

}

html[data-theme="dark"] .calendar-task:hover {

  background: #213152;

}

html[data-theme="dark"] .calendar-task.high {

  background: #2b1d20;

  color: #d99199;

}

html[data-theme="dark"] .calendar-task.medium {

  background: #29261c;

  color: #ceb979;

}

html[data-theme="dark"] .calendar-task.low {

  background: #19251f;

  color: #8cba9e;

}


/* =========================================================
   GOOGLE CALENDAR
========================================================= */

html[data-theme="dark"] .google-calendar-box {

  background: #11171e;

  border-color: #252c35;

}

html[data-theme="dark"] .google-calendar-box h3 {

  color: var(--text);

}

html[data-theme="dark"] .google-calendar-box p {

  color: #858f9d;

}


/* =========================================================
   PLAZOS PROCESALES
========================================================= */

html[data-theme="dark"] .task-type-badge.procedural {

  background: #1b2740;

  color: #9caeff;

}

html[data-theme="dark"] .task-type-badge.fatal {

  background: #2b1d20;

  color: #df929a;

}

html[data-theme="dark"] .task-deadline-status.alert-upcoming {

  background: #282319;

  color: #cfb878;

}

html[data-theme="dark"] .task-deadline-status.alert-tomorrow {

  background: #2b261a;

  color: #d1b76d;

}

html[data-theme="dark"] .task-deadline-status.alert-today {

  background: #301e21;

  color: #df8c95;

}

html[data-theme="dark"] .task-deadline-status.alert-overdue {

  background: #3a1e22;

  color: #efb2b8;

}


/* =========================================================
   DISCLAIMER
========================================================= */

html[data-theme="dark"] .deadline-disclaimer {

  border-color: #5a4a2b;

  background: rgba(120, 95, 35, .08);

}

html[data-theme="dark"] .deadline-disclaimer strong {

  color: #d5bb78;

}

html[data-theme="dark"] .deadline-disclaimer p {

  color: #929aaa;

}


/* =========================================================
   TASK DETAIL
========================================================= */

html[data-theme="dark"] .task-detail-overlay {

  background: rgba(0, 0, 0, .68);

}

html[data-theme="dark"] .task-detail-card {

  background: #141920;

  border: 1px solid #29313c;

}

html[data-theme="dark"] .task-detail-header {

  border-bottom-color: #252c35;

}

html[data-theme="dark"] .task-detail-header h2 {

  color: var(--text);

}

html[data-theme="dark"] .task-detail-item {

  background: #191f27;

  border-color: #29313c;

}

html[data-theme="dark"] .task-detail-item strong {

  color: var(--text);

}

html[data-theme="dark"] .task-detail-procedural {

  border-color: #29313c;

}

html[data-theme="dark"] .task-detail-footer {

  border-top-color: #252c35;

}


/* =========================================================
   CONFIGURACIÓN
========================================================= */

html[data-theme="dark"] .settings-header h1 {

  color: var(--text);

}

html[data-theme="dark"] .settings-card {

  background: #141920;

  border-color: #252c35;

  box-shadow: none;

}

html[data-theme="dark"] .settings-card-title h2 {

  color: var(--text);

}

html[data-theme="dark"] .settings-card-title p {

  color: #818b99;

}

html[data-theme="dark"] .settings-icon {

  background: #1a2028;

  color: #9dafff;

}

html[data-theme="dark"] .settings-row {

  border-top-color: #252c35;

}

html[data-theme="dark"] .settings-row strong {

  color: var(--text);

}

html[data-theme="dark"] .settings-row span {

  color: #757f8d;

}

html[data-theme="dark"] .settings-account {

  border-top-color: #252c35;

}

html[data-theme="dark"] .account-info span {

  color: #737d8c;

}

html[data-theme="dark"] .account-info strong {

  color: var(--text);

}

html[data-theme="dark"] .settings-link {

  border-top-color: #252c35;

  color: #9dafff;

}


/* =========================================================
   FORM MODALS
========================================================= */

html[data-theme="dark"] .task-form {

  background: #141920;

  border-color: #29313c;

  box-shadow:
    0 25px 70px rgba(0,0,0,.45);

}

html[data-theme="dark"] .task-form-header {

  border-bottom-color: #252c35;

}

html[data-theme="dark"] .task-form-header h2 {

  color: var(--text);

}

html[data-theme="dark"] .task-form-footer {

  background: #11171e;

  border-top-color: #252c35;

}

html[data-theme="dark"] .close-task-form-btn:hover {

  background: #1d242d;

}


/* =========================================================
   CONFIRM DIALOG
========================================================= */

html[data-theme="dark"] #confirm-close-dialog {

  background: #141920;

  border-color: #29313c;

  color: var(--text);

}

html[data-theme="dark"] .dialog-content h3 {

  color: var(--text);

}

html[data-theme="dark"] .dialog-content p {

  color: #8b95a3;

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

  html[data-theme="dark"] .sidebar {

    box-shadow:
      10px 0 30px rgba(0,0,0,.3);

  }


}


/* =========================================================
   CALENDARIO — CORRECCIÓN MÓVIL
========================================================= */

.calendar-top {
  min-width: 0;
}

.calendar-top h2 {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* La cuadrícula nunca debe provocar overflow */
.calendar-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.calendar-grid,
.calendar-weekdays {
  width: 100%;
  min-width: 0;
}

/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 700px) {

  .calendar-container {
    padding: 10px;
    overflow: hidden;
  }

  .calendar-top {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 18px;
  }

  .calendar-top h2 {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    text-align: center;
    font-size: 17px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .calendar-arrow {
    width: 36px;
    height: 36px;
    padding: 0;
    flex-shrink: 0;
  }

  .calendar-weekdays {
    gap: 2px;
    padding-bottom: 8px;
    margin-bottom: 5px;
  }

  .calendar-weekdays div {
    min-width: 0;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .calendar-grid {
    gap: 3px;
  }

  .calendar-day {
    min-width: 0;
    min-height: 68px;
    padding: 5px;
    overflow: hidden;
  }

  .calendar-day-number {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .calendar-task {
    max-width: 100%;
    font-size: 9px;
    line-height: 1.2;
    padding: 3px 4px;
    margin-top: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

}


/* =========================================================
   MÓVIL PEQUEÑO
========================================================= */

@media (max-width: 420px) {

  .calendar-container {
    padding: 8px;
  }

  .calendar-top {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 5px;
  }

  .calendar-top h2 {
    font-size: 15px;
  }

  .calendar-arrow {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .calendar-weekdays div {
    font-size: 9px;
  }

  .calendar-day {
    min-height: 60px;
    padding: 4px;
  }

  .calendar-day-number {
    font-size: 10px;
  }

}
/* =========================================================
   LETRIVA — CLEAN WORKSPACE OVERRIDES
   ========================================================= */

:root {
  --background: #f7f7f5;
  --surface: #ffffff;
  --surface-raised: #fafaf8;
  --border: #deded9;
  --border-strong: #c9c9c2;
  --text: #20211f;
  --text-soft: #6f716b;
  --text-muted: #999b94;
  --navy: #202522;
  --navy-soft: #2a302c;
  --blue: #46574d;
  --blue-dark: #37473e;
  --blue-light: #eef1ee;
  --gold: #82775e;
  --gold-light: #f1efe9;
  --green: #4d6858;
  --green-light: #edf2ee;
  --danger: #8a5757;
  --danger-light: #f5eeee;
  --shadow: none;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 12px 35px rgba(20, 24, 21, .08);
}

/* Menos aspecto de plantilla / IA */
*, *::before, *::after {
  box-shadow: none !important;
}

body {
  background: var(--background);
  color: var(--text);
}

.brand-mark {
  background: #28312c !important;
  color: #fff !important;
  box-shadow: none !important;
}

.sidebar {
  background: #252a27 !important;
}

.nav-item.active {
  background: rgba(255,255,255,.07) !important;
}

.nav-item.active .nav-icon {
  color: #d9ddd9 !important;
}

.upgrade-card {
  background: rgba(255,255,255,.035) !important;
}

.primary-btn {
  background: #35433b !important;
  border: 1px solid #35433b !important;
  box-shadow: none !important;
}

.primary-btn:hover {
  background: #2d3932 !important;
  transform: none !important;
}

.secondary-btn,
.filter-btn {
  background: #fff !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

.secondary-btn:hover,
.filter-btn:hover {
  background: #f5f5f2 !important;
  border-color: var(--border-strong) !important;
}

.stat-card,
.task,
.case-card,
.client-card,
.alert-item,
.settings-card,
.calendar-container {
  box-shadow: none !important;
  border-color: var(--border) !important;
}

.stat-card:hover,
.task:hover,
.case-card:hover,
.client-card:hover {
  transform: none !important;
  box-shadow: none !important;
}

.task::before {
  background: #69776e !important;
}

.task-priority.high,
.task-priority.medium,
.task-priority.low,
.stat-icon.blue,
.stat-icon.gold,
.stat-icon.green {
  background: #f1f2ef !important;
  color: #555b56 !important;
}

.task-priority.high {
  color: #805656 !important;
  background: #f4eeee !important;
}

.task-type-badge.procedural {
  background: #eef1ef !important;
  color: #526158 !important;
}

.task-type-badge.fatal {
  background: #f4eeee !important;
  color: #805656 !important;
}

.task-deadline-status {
  background: #f1f2ef !important;
  color: #555b56 !important;
}

.form-control,
.input-group input,
#client-search-input {
  background: #fff !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.form-control:focus,
.input-group input:focus,
#client-search-input:focus {
  border-color: #65736a !important;
  box-shadow: 0 0 0 2px rgba(70,87,77,.08) !important;
}

/* =========================================================
   DASHBOARD LIMPIO
   ========================================================= */

.dashboard {
  max-width: 1180px;
  padding: 42px 40px 60px;
}

.welcome-row {
  margin-bottom: 30px;
}

.welcome-row h1,
.page-header h1,
.section-header h2 {
  color: var(--text) !important;
}

.stats-grid {
  gap: 12px;
  margin-bottom: 38px;
}

.stat-card {
  min-height: 120px;
  padding: 20px;
  border-radius: 10px;
}

.stat-number {
  color: var(--text) !important;
}

/* =========================================================
   NUEVO WORKSPACE DE TAREAS
   ========================================================= */

.tasks-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.task-folders-panel {
  position: sticky;
  top: 24px;
  padding-right: 18px;
  border-right: 1px solid var(--border);
}

.task-folders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 8px;
}

.task-folders-header span {
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.task-folders-header button {
  width: 27px;
  height: 27px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.task-folders-header button:hover {
  background: #f3f3f0;
}

.task-folder-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 9px;
  margin-bottom: 3px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  font-size: .76rem;
  cursor: pointer;
}

.task-folder-option strong {
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 600;
}

.task-folder-option:hover {
  background: #f0f1ee;
  color: var(--text);
}

.task-folder-option.active {
  background: #eceeeb;
  color: var(--text);
  font-weight: 600;
}

.task-folders-panel #task-folders-list {
  margin-top: 3px;
}

.tasks-workspace-main {
  min-width: 0;
}

.tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tasks-search {
  flex: 1;
  min-width: 0;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
}

.tasks-search span {
  color: var(--text-muted);
  font-size: 1rem;
}

.tasks-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: .78rem;
}

.tasks-search:focus-within {
  border-color: #65736a;
}

.tasks-workspace .task {
  border-radius: 8px;
  padding: 16px 18px 15px 20px;
}

.tasks-workspace .task .task-actions {
  margin-top: 8px;
}

.tasks-page-header {
  margin-bottom: 26px;
}

.tasks-page-header h1 {
  margin-top: 7px;
}

.tasks-page-header p {
  color: var(--text-soft);
}

#tasks-workspace-empty {
  margin-top: 12px;
}

/* =========================================================
   DASHBOARD: SOLO IMPORTANTES
   ========================================================= */

.dashboard .todo-app {
  min-height: 0;
}

.dashboard .task {
  padding: 16px 18px 15px 20px;
}

.dashboard .task-description {
  max-width: 760px;
}

/* =========================================================
   DARK MODE DISCRETO
   ========================================================= */

html[data-theme="dark"] {
  --background: #111412;
  --surface: #181c19;
  --surface-raised: #1c211e;
  --border: #2b312d;
  --border-strong: #39413b;
  --text: #e9ece9;
  --text-soft: #a6ada7;
  --text-muted: #747c76;
  --blue: #9eaba2;
  --blue-dark: #b1bbb4;
}

html[data-theme="dark"] .tasks-search,
html[data-theme="dark"] .task-folders-header button,
html[data-theme="dark"] .secondary-btn,
html[data-theme="dark"] .filter-btn {
  background: var(--surface) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .task-folder-option:hover,
html[data-theme="dark"] .task-folder-option.active {
  background: #202620;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 850px) {
  .tasks-workspace {
    grid-template-columns: 1fr;
  }

  .task-folders-panel {
    position: static;
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .task-folders-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .task-folders-header {
    width: 100%;
  }

  .task-folder-option {
    width: auto;
    flex: 0 1 auto;
    padding: 0 10px;
  }

  #task-folders-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
}

@media (max-width: 650px) {
  .dashboard {
    padding: 30px 18px 45px;
  }

  .tasks-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tasks-toolbar .filter-wrapper {
    align-self: flex-start;
  }

  .welcome-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   TAREAS
======================================== */

.tasks-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  align-items: center;
}

.task-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-search input {
  width: 100%;
}


.task-folders-section {
  margin-bottom: 40px;
}


.task-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


.task-folder {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 12px 16px;

  background: #fff;

  border: 1px solid #e5e7eb;

  border-radius: 8px;

  cursor: pointer;

  font: inherit;

  color: #222;

  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}


.task-folder:hover {
  background: #f7f7f7;
  border-color: #d1d5db;
}


.task-folder-icon {
  font-size: 18px;
}


.task-folder-name {
  font-weight: 500;
}


@media (max-width: 700px) {

  .tasks-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

}

.task-folder-modal{
background:
    var(--surface);

  border:
    1px solid var(--border);

  border-radius:
    18px;

  box-shadow:
    var(--shadow-lg);
  }
  /* Contenedor de Notificaciones */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100% - 48px);
  pointer-events: none;
} 

/* Elemento Toast Base */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #1a1a1a;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: #1a1a1a;
  opacity: 0;
  transform: translateY(15px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Iconos de tipo */
.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Variantes de color */
.toast-success { border-left-color: #10b981; }
.toast-success .toast-icon { background: #d1fae5; color: #065f46; }

.toast-error { border-left-color: #ef4444; }
.toast-error .toast-icon { background: #fee2e2; color: #991b1b; }

.toast-warning { border-left-color: #f59e0b; }
.toast-warning .toast-icon { background: #fef3c7; color: #92400e; }

.toast-info { border-left-color: #3b82f6; }
.toast-info .toast-icon { background: #dbeafe; color: #1e40af; }
.custom-modal-dialog {
  border: none;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 420px;
  background: #ffffff;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

.custom-modal-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
}

.custom-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.custom-modal-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

.custom-modal-buttons button {
  flex: 1;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
.share-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background-color: var(--bg-surface, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
}

.share-member-info {
  display: flex;
  flex-direction: column;
}

.share-member-email {
  font-weight: 600;
  font-size: 0.9rem;
}

.share-member-role-badge {
  font-size: 0.75rem;
  color: #6b7280;
}

.share-role-badge-editor {
  color: #2563eb;
  font-weight: 600;
}

.share-role-badge-lector {
  color: #059669;
  font-weight: 600;
}
.pwa-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  background-color: #0f172a;
  color: #ffffff;
  padding: 10px 20px;
  border-bottom: 1px solid #334155;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.pwa-banner.hidden {
  display: none !important;
}

.pwa-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9rem;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-btn {
  padding: 6px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.pwa-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.pwa-close-btn:hover {
  color: #ffffff;
}