
/* ==========================================================
   CONTROL ASISTENCIA SAAS - PREMIUM UI
   Paleta corporativa:
   Azul eléctrico: rgb(47,128,255) / Pantone 2727C
   Azul intenso:   rgb(26,77,255)  / Pantone 2728C
   Índigo violeta: rgb(106,92,255) / Pantone 2725C
   ========================================================== */

:root{
  --primary: rgb(47,128,255);
  --secondary: rgb(26,77,255);
  --tertiary: rgb(106,92,255);

  --brand-electric: rgb(47,128,255);
  --brand-intense: rgb(26,77,255);
  --brand-indigo: rgb(106,92,255);

  --brand-gradient: linear-gradient(135deg, rgb(47,128,255) 0%, rgb(26,77,255) 52%, rgb(106,92,255) 100%);
  --brand-gradient-vertical: linear-gradient(180deg, #081a63 0%, rgb(26,77,255) 56%, rgb(106,92,255) 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(47,128,255,.18), rgba(26,77,255,.12), rgba(106,92,255,.20));

  --bg-main: #f4f7ff;
  --bg-dark: #07113f;
  --card: rgba(255,255,255,.88);
  --card-dark: rgba(8,17,63,.66);
  --text: #0f172a;
  --muted: #64748b;
  --white-soft: rgba(255,255,255,.88);
  --border: rgba(47,128,255,.18);
  --border-dark: rgba(255,255,255,.14);
  --shadow: 0 24px 70px rgba(26,77,255,.18);
  --shadow-strong: 0 30px 90px rgba(26,77,255,.28);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

*{box-sizing:border-box}

html{
  min-height:100%;
  background:#f4f7ff;
}

body{
  margin:0;
  min-height:100vh;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(47,128,255,.26), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(106,92,255,.22), transparent 34%),
    linear-gradient(135deg, #eef5ff 0%, #f7f8ff 48%, #eef2ff 100%);
}

/* =========================
   LAYOUT
   ========================= */

.app{
  display:flex;
  min-height:100vh;
  width:100%;
}

.sidebar{
  width:292px;
  min-width:292px;
  height:100vh;
  position:sticky;
  top:0;
  overflow:auto;
  padding:26px 22px;
  color:#fff;
  background:
    radial-gradient(circle at 20% 0%, rgba(47,128,255,.78), transparent 28%),
    radial-gradient(circle at 90% 18%, rgba(106,92,255,.75), transparent 28%),
    var(--brand-gradient-vertical) !important;
  border-right:1px solid rgba(255,255,255,.18);
  box-shadow: 18px 0 55px rgba(26,77,255,.23);
}

.sidebar::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), transparent 36%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.055) 0 1px, transparent 1px 16px);
  pointer-events:none;
}

.sidebar > *{
  position:relative;
  z-index:1;
}

.brand{
  display:flex;
  align-items:center;
  gap:13px;
  margin-bottom:30px;
  padding:12px;
  border-radius:22px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 16px 40px rgba(0,0,0,.14);
}

.brand strong{
  color:#fff;
  font-size:17px;
  letter-spacing:-.02em;
  line-height:1.1;
}

.brand img{
  width:52px;
  height:52px;
  border-radius:17px;
  object-fit:contain;
  background:#fff;
  padding:6px;
  box-shadow:0 12px 30px rgba(0,0,0,.16);
}

.logo-dot{
  width:52px;
  height:52px;
  border-radius:18px;
  background:
    radial-gradient(circle at 30% 25%, #fff, rgba(255,255,255,.2) 28%, transparent 30%),
    var(--brand-gradient);
  box-shadow:0 0 0 8px rgba(255,255,255,.10), 0 16px 35px rgba(0,0,0,.18);
}

nav a{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  color:rgba(255,255,255,.86);
  text-decoration:none;
  padding:13px 14px;
  border-radius:16px;
  margin:7px 0;
  font-weight:750;
  letter-spacing:-.01em;
  transition:all .18s ease;
  border:1px solid transparent;
}

nav a:hover,
nav a.active{
  color:#fff;
  background:rgba(255,255,255,.16);
  border-color:rgba(255,255,255,.18);
  transform:translateX(4px);
  box-shadow:0 14px 32px rgba(0,0,0,.12);
}

.main{
  flex:1;
  padding:30px;
  min-width:0;
}

.top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:24px;
  padding:22px 24px;
  border-radius:var(--radius-xl);
  background:rgba(255,255,255,.78);
  border:1px solid rgba(47,128,255,.16);
  box-shadow:0 18px 50px rgba(26,77,255,.10);
  backdrop-filter:blur(18px);
}

.top h1{
  margin:0;
  font-size:clamp(30px, 4vw, 46px);
  letter-spacing:-.055em;
  line-height:.98;
  background:var(--brand-gradient);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.top p{
  margin:7px 0 0;
  color:var(--muted);
  font-weight:700;
}

/* =========================
   LOGIN
   ========================= */

.login{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 12% 12%, rgba(47,128,255,.34), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(106,92,255,.30), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(26,77,255,.16), transparent 36%),
    linear-gradient(135deg, #eff6ff 0%, #f7f7ff 55%, #eef2ff 100%);
  position:relative;
  overflow:hidden;
}

.login::before{
  content:"";
  position:absolute;
  width:620px;
  height:620px;
  border-radius:50%;
  background:var(--brand-gradient);
  filter:blur(58px);
  opacity:.18;
  right:-210px;
  bottom:-260px;
}

.login .card{
  width:min(470px,100%);
  padding:34px;
  position:relative;
  z-index:1;
  background:rgba(255,255,255,.84) !important;
  color:var(--text) !important;
  border:1px solid rgba(255,255,255,.72) !important;
  box-shadow:0 35px 100px rgba(26,77,255,.24) !important;
  backdrop-filter:blur(22px);
}

.login .card h1{
  margin-top:0;
  font-size:36px;
  line-height:1;
  letter-spacing:-.055em;
  background:var(--brand-gradient);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.login input{
  background:#fff !important;
  color:#0f172a !important;
  border-color:rgba(47,128,255,.22) !important;
}

.login label{
  color:#334155 !important;
}

/* =========================
   CARDS / GRID
   ========================= */

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:20px;
}

.card{
  background:var(--card) !important;
  color:var(--text) !important;
  border:1px solid rgba(47,128,255,.16) !important;
  border-radius:var(--radius-xl) !important;
  padding:24px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(18px);
  overflow:hidden;
  position:relative;
}

.card::before{
  content:"";
  position:absolute;
  inset:0 0 auto;
  height:4px;
  background:var(--brand-gradient);
  opacity:.95;
}

.card h2,
.card h3{
  margin-top:4px;
  letter-spacing:-.035em;
  color:#111827;
}

.card:hover{
  box-shadow:var(--shadow-strong);
}

.metric{
  font-size:42px;
  font-weight:950;
  letter-spacing:-.06em;
  background:var(--brand-gradient);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

/* =========================
   BOTONES
   ========================= */

.btn,
button,
input[type=submit]{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  border:0;
  border-radius:16px;
  padding:11px 17px;
  background:var(--brand-gradient) !important;
  color:#fff !important;
  text-decoration:none;
  font-weight:850;
  letter-spacing:-.015em;
  cursor:pointer;
  box-shadow:0 16px 34px rgba(26,77,255,.27);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn:hover,
button:hover,
input[type=submit]:hover{
  transform:translateY(-1px);
  filter:saturate(1.08);
  box-shadow:0 22px 45px rgba(26,77,255,.36);
}

.btn.secondary{
  background:rgba(26,77,255,.08) !important;
  color:rgb(26,77,255) !important;
  border:1px solid rgba(26,77,255,.16);
  box-shadow:none;
}

.btn.danger,
button.danger{
  background:linear-gradient(135deg,#ef4444,#f97316) !important;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* =========================
   FORMULARIOS
   ========================= */

label{
  display:block;
  font-size:13px;
  color:#334155;
  font-weight:800;
  margin-bottom:6px;
}

input,
select,
textarea{
  width:100%;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(26,77,255,.18);
  background:#fff;
  color:#0f172a;
  margin:7px 0 14px;
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus{
  border-color:rgb(47,128,255);
  box-shadow:0 0 0 4px rgba(47,128,255,.16);
}

input[type=file]{
  background:linear-gradient(135deg, rgba(47,128,255,.07), rgba(106,92,255,.08));
  border-style:dashed;
}

input[type=color]{
  height:48px;
  padding:5px;
}

textarea{
  resize:vertical;
}

/* =========================
   TABLAS
   ========================= */

.table-container{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:22px;
  background:rgba(255,255,255,.82);
  border:1px solid rgba(47,128,255,.15);
  box-shadow:0 14px 40px rgba(26,77,255,.09);
}

.table th,
.table td{
  padding:14px 13px;
  text-align:left;
  border-bottom:1px solid rgba(47,128,255,.10);
  color:#1f2937;
}

.table th{
  background:linear-gradient(135deg, rgba(47,128,255,.14), rgba(106,92,255,.16));
  color:#172554;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:950;
}

.table tr:hover td{
  background:rgba(47,128,255,.055);
}

/* =========================
   BADGES / STATUS
   ========================= */

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(26,77,255,.10);
  color:rgb(26,77,255);
  font-weight:850;
  font-size:12px;
  border:1px solid rgba(26,77,255,.12);
}

.badge.ok,
.ok{
  background:rgba(34,197,94,.13) !important;
  color:#166534 !important;
  border-color:rgba(34,197,94,.22) !important;
}

.badge.warn,
.warn{
  background:rgba(245,158,11,.16) !important;
  color:#92400e !important;
  border-color:rgba(245,158,11,.24) !important;
}

.badge.danger,
.danger{
  background:rgba(239,68,68,.13) !important;
  color:#991b1b !important;
  border-color:rgba(239,68,68,.22) !important;
}

/* =========================
   COMPONENTES EXISTENTES
   ========================= */

.avatar{
  width:50px;
  height:50px;
  border-radius:18px;
  object-fit:cover;
  border:2px solid rgba(47,128,255,.18);
  box-shadow:0 12px 26px rgba(26,77,255,.12);
}

.logo-preview{
  margin:10px 0 18px;
}

.logo-preview img{
  width:132px;
  height:132px;
  object-fit:contain;
  border-radius:26px;
  background:#fff;
  padding:14px;
  border:1px solid rgba(47,128,255,.18);
  box-shadow:0 16px 42px rgba(26,77,255,.13);
}

.qr{
  background:#fff;
  padding:16px;
  border-radius:26px;
  display:inline-block;
  box-shadow:0 18px 42px rgba(26,77,255,.14);
  border:1px solid rgba(47,128,255,.16);
}

.muted{
  color:var(--muted) !important;
}

.calendar{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:10px;
}

.day{
  padding:14px;
  border-radius:16px;
  background:linear-gradient(135deg, rgba(47,128,255,.10), rgba(106,92,255,.10));
  border:1px solid rgba(47,128,255,.14);
  color:#1e293b;
  font-weight:750;
}

hr{
  border:0;
  border-top:1px solid rgba(47,128,255,.16);
  margin:20px 0;
}

details{
  margin-top:8px;
}

summary{
  cursor:pointer;
  color:rgb(26,77,255);
  font-weight:850;
}

.inline-form{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.inline-form input{
  max-width:160px;
  margin:0;
}

.mini-form{
  display:grid;
  gap:8px;
  margin-top:10px;
  min-width:260px;
}

.mini-form input{
  width:100%;
}

/* =========================
   DARK CONTENT FIX
   ========================= */

.card input,
.card select,
.card textarea{
  background:#fff;
  color:#0f172a;
}

.card a{
  color:rgb(26,77,255);
  font-weight:800;
}

a{
  color:rgb(26,77,255);
}

a:hover{
  color:rgb(106,92,255);
}

/* =========================
   RESPONSIVE
   ========================= */

@media(max-width:900px){
  .app{
    display:block;
  }
  .sidebar{
    position:relative;
    width:100%;
    min-width:0;
    height:auto;
    border-radius:0 0 28px 28px;
  }
  .main{
    padding:18px;
  }
  .top{
    display:block;
  }
  .table{
    display:block;
    overflow-x:auto;
  }
}
