@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Montserrat:wght@700;800&display=swap');

:root{
  --green:#34A853;
  --red:#6B1E11;
  --green2:#1A542A;
  --red2:#AA3522;
  --dark:#0D2A15;
  --paper:#F5F3EB;

  --radius:16px;
  --shadow:0 10px 24px rgba(0,0,0,.08);
  --border:rgba(0,0,0,.10);
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--paper);
  color:#111;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

h1,h2,h3{
  font-family:Montserrat, Inter, sans-serif;
  margin:0 0 12px;
}

a{
  color:inherit;
  text-decoration:none;
}

.container{
  max-width:1100px;
  margin:0 auto;
  padding:22px;
}

.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:14px;
}

.col-3{ grid-column:span 3; }
.col-6{ grid-column:span 6; }
.col-12{ grid-column:span 12; }

@media(max-width:900px){
  .col-3,
  .col-6{
    grid-column:span 12;
  }
}

label{
  font-weight:700;
  display:block;
  margin:12px 0 6px;
}

input, select, textarea{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  outline:none;
  background:#fff;
  font:inherit;
}

textarea{
  min-height:110px;
  resize:vertical;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:800;
  font:inherit;
}

.btn-primary{
  background:var(--green);
  color:#fff;
}

.btn-secondary{
  background:var(--red);
  color:#fff;
}

.btn-ghost{
  background:#fff;
  border-color:var(--border);
}

.btn-danger{
  background:var(--red2);
  color:#fff;
}

.badge{
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  border:1px solid var(--border);
  display:inline-block;
}

.badge.pending{
  background:rgba(52,168,83,.12);
  color:var(--green2);
}

.badge.delete_pending{
  background:rgba(170,53,34,.12);
  color:var(--red2);
}

.badge.deleted{
  background:rgba(0,0,0,.08);
  color:#333;
}

.alert{
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.03);
}

.alert.ok{
  background:rgba(52,168,83,.12);
  border-color:rgba(52,168,83,.25);
}

.alert.err{
  background:rgba(170,53,34,.12);
  border-color:rgba(170,53,34,.25);
}

.table{
  width:100%;
  border-collapse:collapse;
}

.table th,
.table td{
  padding:10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}

.table th{
  font-family:Montserrat, Inter, sans-serif;
  font-size:13px;
  letter-spacing:.06em;
}

/* =========================
   NAV LIMPIO Y ÚNICO
========================= */

.cra-nav{
  background:#fff;
  border-bottom:1px solid var(--border);
  box-shadow:0 4px 14px rgba(0,0,0,.04);
}

.cra-nav-inner{
  max-width:1100px;
  margin:0 auto;
  padding:18px 22px 20px;
}

.cra-nav-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.cra-brand-wrap{
  display:flex;
  align-items:center;
  gap:14px;
}

.cra-brand-logo{
  width:64px;
  height:64px;
  object-fit:contain;
  flex-shrink:0;
}

.brand{
  display:flex;
  flex-direction:column;
}

.brand small{
  color:var(--green2);
  font-weight:700;
  letter-spacing:.08em;
}

.brand strong{
  font-family:Montserrat, Inter, sans-serif;
  font-size:18px;
}

.cra-user-box{
  background:var(--paper);
  border:1px solid var(--border);
  border-radius:999px;
  padding:10px 14px;
  font-weight:700;
}

.cra-accordion{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.cra-accordion-item{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
}

.cra-accordion-item summary{
  list-style:none;
  cursor:pointer;
  padding:16px 18px;
  font-family:Montserrat, Inter, sans-serif;
  font-size:16px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#111;
  background:#fff;
}

.cra-accordion-item summary::-webkit-details-marker{
  display:none;
}

.cra-accordion-item summary::after{
  content:"+";
  font-size:22px;
  font-weight:800;
  color:var(--green2);
  line-height:1;
}

.cra-accordion-item[open] summary{
  border-bottom:1px solid var(--border);
  background:rgba(52,168,83,.05);
}

.cra-accordion-item[open] summary::after{
  content:"−";
}

.cra-accordion-content{
  padding:14px 18px 16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  background:#fff;
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  border:1px solid var(--border);
  border-radius:999px;
  padding:10px 14px;
  font-size:14px;
  font-weight:700;
  transition:.15s ease;
}

.pill:hover{
  border-color:rgba(0,0,0,.22);
  transform:translateY(-1px);
}

@media (max-width:700px){
  .cra-nav-inner{
    padding:16px;
  }

  .cra-brand-logo{
    width:56px;
    height:56px;
  }

  .cra-user-box{
    width:100%;
  }

  .cra-accordion-item summary{
    font-size:15px;
    padding:14px 16px;
  }

  .cra-accordion-content{
    padding:12px 16px 14px;
  }
}



/* =========================
   NAV HORIZONTAL CRA
========================= */

.topnav-cra{
  background:linear-gradient(135deg, var(--green2) 0%, var(--green) 62%, #49b663 100%);
  border-bottom:1px solid rgba(255,255,255,.14);
  box-shadow:0 10px 28px rgba(13,42,21,.16);
  position:sticky;
  top:0;
  z-index:1000;
}

.topnav-inner{
  max-width:1200px;
  margin:0 auto;
  padding:14px 20px 16px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.topnav-brand-row{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.topnav-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.topnav-logo{
  width:54px;
  height:54px;
  object-fit:contain;
  background:#fff;
  border-radius:12px;
  padding:4px;
}

.topnav-brand-text{
  display:flex;
  flex-direction:column;
}

.topnav-brand-text small{
  color:#eaf7ee;
  font-weight:700;
  letter-spacing:.08em;
}

.topnav-brand-text strong{
  color:#fff;
  font-family:Montserrat, Inter, sans-serif;
  font-size:18px;
  line-height:1.1;
}

.topnav-menu{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  width:100%;
}

.topnav-item{
  position:relative;
}

.topnav-item > a,
.topnav-dropdown-toggle{
  display:block;
  color:#fff;
  font-weight:700;
  padding:11px 15px;
  border-radius:999px;
  transition:.18s ease;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  font:inherit;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  box-shadow:none;
}

.topnav-item > a:hover,
.topnav-dropdown-toggle:hover,
.topnav-item.is-open > .topnav-dropdown-toggle{
  background:rgba(255,255,255,.16);
  border-color:rgba(255,255,255,.24);
}

.topnav-item.has-dropdown{
  position:relative;
}

.topnav-dropdown-toggle::after{
  content:"v";
  margin-left:8px;
  font-size:12px;
}

.dropdown-menu{
  list-style:none;
  margin:0;
  padding:10px 0;
  min-width:240px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 22px 46px rgba(13,42,21,.14);
  position:absolute;
  top:calc(100% + 10px);
  left:0;
  z-index:999;
  display:none;
}

.topnav-item.is-open > .dropdown-menu{
  display:block;
}

@media (min-width: 981px){
  .topnav-item.has-dropdown:hover > .dropdown-menu,
  .topnav-item.has-dropdown:focus-within > .dropdown-menu{
    display:block;
  }
}

.dropdown-menu li a{
  display:block;
  padding:12px 16px;
  color:#111;
  font-weight:600;
  transition:.15s ease;
}

.dropdown-subitem{
  position:relative;
}

.dropdown-subtoggle{
  width:100%;
  text-align:left;
  border:none;
  background:#fff;
  color:#111;
  font:inherit;
  font-weight:700;
  padding:12px 16px;
  cursor:pointer;
}

.dropdown-subtoggle::after{
  content:">";
  float:right;
  opacity:.7;
}

.dropdown-subtoggle:hover{
  background:rgba(52,168,83,.08);
  color:var(--green2);
}

.dropdown-submenu{
  list-style:none;
  margin:0;
  padding:8px 0;
  min-width:220px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 18px 36px rgba(13,42,21,.12);
  position:absolute;
  top:0;
  left:calc(100% - 6px);
  z-index:1000;
  display:none;
}

.dropdown-subitem.is-open > .dropdown-submenu{
  display:block;
}

@media (min-width: 981px){
  .dropdown-subitem.has-submenu:hover > .dropdown-submenu,
  .dropdown-subitem.has-submenu:focus-within > .dropdown-submenu{
    display:block;
  }
}

.dropdown-submenu li a{
  display:block;
  padding:12px 16px;
  color:#111;
  font-weight:600;
}

.dropdown-submenu li a:hover{
  background:rgba(52,168,83,.08);
  color:var(--green2);
}

.dropdown-menu li a:hover{
  background:rgba(52,168,83,.08);
  color:var(--green2);
}

.topnav-user{
  color:#fff;
  font-weight:700;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.18);
  padding:11px 16px;
  border-radius:999px;
  white-space:nowrap;
}

.topnav-user a{
  color:inherit;
}

.topnav-item-exit{
  margin-left:auto;
}

.topnav-item-exit > a{
  background:rgba(107,30,17,.24);
  border-color:rgba(255,255,255,.12);
}

@media (max-width: 980px){
  .topnav-brand-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .topnav-menu{
    align-items:stretch;
  }

  .topnav-user{
    width:100%;
    white-space:normal;
  }

  .topnav-item{
    width:100%;
  }

  .topnav-item > a,
  .topnav-dropdown-toggle{
    width:100%;
  }

  .dropdown-menu{
    position:static;
    margin-top:8px;
    width:100%;
    min-width:0;
    box-shadow:none;
  }

  .dropdown-submenu{
    position:static;
    margin:8px 12px 0;
    width:auto;
    min-width:0;
    box-shadow:none;
  }

  .topnav-item-exit{
    margin-left:0;
  }
}

/* =========================
   FOOTER CRA
========================= */

.cra-footer{
  margin-top:auto;
  background:linear-gradient(135deg, var(--green2) 0%, var(--green) 62%, #49b663 100%);
  border-top:1px solid rgba(255,255,255,.12);
  box-shadow:0 -8px 24px rgba(13,42,21,.10);
}

.cra-footer-topbar{
  height:10px;
  background:linear-gradient(90deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.08) 100%);
}

.cra-footer-inner{
  max-width:1200px;
  margin:0 auto;
  padding:18px 20px 24px;
  display:flex;
  justify-content:center;
}

.cra-footer-content{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.cra-footer-user{
  color:#f3fff7;
  font-weight:700;
  font-size:14px;
}

.cra-footer-brand{
  color:#ffffff;
  font-family:Montserrat, Inter, sans-serif;
  font-size:15px;
  font-weight:800;
  letter-spacing:.02em;
}

@media (max-width:700px){
  .cra-footer-inner{
    padding:16px 16px 18px;
  }

  .cra-footer-user{
    font-size:13px;
  }

  .cra-footer-brand{
    font-size:14px;
    line-height:1.4;
  }
}

/* =========================
   SIDEBAR CRA
========================= */

body.sidebar-layout{
  padding-left:290px;
  transition:padding-left .22s ease;
}

body.sidebar-collapsed{
  padding-left:98px;
}

body.sidebar-layout .container,
body.sidebar-layout .home-shell,
body.sidebar-layout .dashboard-shell{
  width:100%;
  max-width:none;
  margin:0;
}

body.sidebar-layout .container{
  padding:24px 28px 28px;
}

body.sidebar-layout .home-shell,
body.sidebar-layout .dashboard-shell{
  padding:24px 28px 28px;
}

.sidebar-cra{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  width:290px;
  background:linear-gradient(180deg, #0d2a15 0%, #1a542a 34%, #2f7f44 100%);
  box-shadow:20px 0 40px rgba(8,28,14,.18);
  z-index:1200;
  transition:width .22s ease, transform .22s ease;
}

.sidebar-shell{
  height:100%;
  display:flex;
  flex-direction:column;
  padding:20px 16px;
  gap:16px;
  overflow:visible;
}

.sidebar-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.sidebar-logo{
  width:54px;
  height:54px;
  object-fit:contain;
  background:#fff;
  border-radius:14px;
  padding:4px;
  flex-shrink:0;
}

.sidebar-brand-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.sidebar-brand-copy small{
  color:#c9efd3;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
}

.sidebar-brand-copy strong{
  color:#fff;
  font-family:Montserrat, Inter, sans-serif;
  font-size:18px;
  line-height:1.1;
}

.sidebar-toggle,
.sidebar-mobile-toggle{
  border:none;
  cursor:pointer;
  font:inherit;
}

.sidebar-toggle{
  width:44px;
  height:44px;
  border-radius:14px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
  display:inline-flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:4px;
  flex-shrink:0;
}

.sidebar-toggle span{
  width:18px;
  height:2px;
  background:#fff;
  border-radius:999px;
  display:block;
}

.sidebar-user-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border-radius:20px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
}

.sidebar-user-avatar{
  width:44px;
  height:44px;
  border-radius:16px;
  background:#fff;
  color:#1a542a;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:18px;
  flex-shrink:0;
}

.sidebar-user-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.sidebar-user-copy strong,
.sidebar-user-copy small{
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebar-user-copy small{
  color:#d7f3de;
  font-size:12px;
}

.sidebar-menu{
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow:auto;
  padding-right:4px;
}

.sidebar-group{
  display:flex;
  flex-direction:column;
  gap:8px;
  position:relative;
}

.sidebar-link{
  width:100%;
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:16px;
  color:#f4fff7;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  transition:.18s ease;
}

.sidebar-link:hover,
.sidebar-link.is-active,
.sidebar-group.is-active > .sidebar-group-toggle{
  background:rgba(255,255,255,.16);
  border-color:rgba(255,255,255,.18);
}

.sidebar-group-toggle{
  font:inherit;
  cursor:pointer;
}

.sidebar-icon{
  width:24px;
  min-width:24px;
  text-align:center;
  font-size:18px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:24px;
  border-radius:10px;
  background:rgba(255,255,255,.08);
}

.sidebar-label,
.sidebar-brand-copy,
.sidebar-user-copy,
.sidebar-caret,
.sidebar-submenu{
  transition:opacity .18s ease, max-height .18s ease, transform .18s ease;
}

.sidebar-label{
  flex:1 1 auto;
  font-weight:700;
}

.sidebar-caret{
  font-size:22px;
  line-height:1;
  transform:rotate(90deg);
}

.sidebar-group.is-open > .sidebar-group-toggle .sidebar-caret{
  transform:rotate(-90deg);
}

.sidebar-submenu{
  display:grid;
  gap:6px;
  padding-left:18px;
}

.sidebar-group:not(.is-open) .sidebar-submenu{
  display:none;
}

.sidebar-sublink{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:14px;
  color:#dff7e6;
}

.sidebar-sublink:hover,
.sidebar-sublink.is-active{
  background:rgba(255,255,255,.10);
  color:#fff;
}

.sidebar-sublink-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#9ed7ad;
  flex-shrink:0;
}

.sidebar-footer-actions{
  margin-top:auto;
  padding-top:8px;
}

.sidebar-link-exit{
  background:rgba(107,30,17,.30);
}

.sidebar-mobile-bar,
.sidebar-overlay{
  display:none;
}

body.sidebar-collapsed .sidebar-cra{
  width:98px;
}

body.sidebar-collapsed .sidebar-brand-copy,
body.sidebar-collapsed .sidebar-user-copy,
body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .sidebar-caret{
  display:none;
}

body.sidebar-collapsed .sidebar-submenu{
  display:none !important;
}

body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .sidebar-user-card,
body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-group-toggle{
  justify-content:center;
}

body.sidebar-collapsed .sidebar-shell{
  padding-left:12px;
  padding-right:12px;
}

body.sidebar-collapsed .sidebar-head{
  justify-content:center;
}

body.sidebar-collapsed .sidebar-brand{
  display:none;
}

body.sidebar-collapsed .sidebar-toggle{
  margin:0 auto;
}

body.sidebar-collapsed .sidebar-menu{
  overflow:visible;
}

body.sidebar-collapsed .sidebar-group{
  gap:0;
}

body.sidebar-collapsed .sidebar-user-card{
  padding:10px;
  justify-content:center;
}

body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-group-toggle{
  padding:12px 0;
  gap:0;
}

body.sidebar-collapsed .sidebar-icon{
  margin:0 auto;
}

body.sidebar-collapsed .sidebar-group.is-open > .sidebar-submenu{
  display:grid !important;
  position:absolute;
  top:0;
  left:84px;
  min-width:240px;
  padding:10px;
  border-radius:18px;
  background:#ffffff;
  border:1px solid rgba(13,42,21,.10);
  box-shadow:0 18px 36px rgba(13,42,21,.18);
  z-index:1400;
}

body.sidebar-collapsed .sidebar-group.is-open > .sidebar-submenu .sidebar-sublink{
  color:#16331d;
}

body.sidebar-collapsed .sidebar-group.is-open > .sidebar-submenu .sidebar-sublink:hover,
body.sidebar-collapsed .sidebar-group.is-open > .sidebar-submenu .sidebar-sublink.is-active{
  background:rgba(52,168,83,.10);
  color:#0d2a15;
}

body.sidebar-collapsed .sidebar-group.is-open > .sidebar-submenu .sidebar-sublink-dot{
  background:#34A853;
}

@media (max-width: 980px){
  body.sidebar-layout,
  body.sidebar-collapsed{
    padding-left:0;
    padding-top:78px;
  }

  body.sidebar-layout .container,
  body.sidebar-layout .home-shell,
  body.sidebar-layout .dashboard-shell{
    width:auto;
    max-width:none;
    margin:0;
  }

  body.sidebar-layout .container,
  body.sidebar-layout .home-shell,
  body.sidebar-layout .dashboard-shell{
    padding:16px;
  }

  .sidebar-cra{
    transform:translateX(-100%);
    width:290px;
  }

  body.sidebar-mobile-open .sidebar-cra{
    transform:translateX(0);
  }

  .sidebar-mobile-bar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    height:78px;
    padding:16px;
    background:linear-gradient(135deg, var(--green2) 0%, var(--green) 62%, #49b663 100%);
    display:flex;
    align-items:center;
    justify-content:space-between;
    z-index:1190;
    box-shadow:0 10px 24px rgba(13,42,21,.16);
  }

  .sidebar-mobile-toggle{
    padding:10px 14px;
    border-radius:14px;
    background:rgba(255,255,255,.14);
    color:#fff;
    font-weight:800;
    border:1px solid rgba(255,255,255,.18);
  }

  .sidebar-mobile-title{
    color:#fff;
    font-family:Montserrat, Inter, sans-serif;
    font-size:18px;
    font-weight:800;
  }

  .sidebar-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.34);
    z-index:1180;
  }

  body.sidebar-mobile-open .sidebar-overlay{
    display:block;
  }
}
