/* AlberdiNET Cobranzas - UI clean & readable */

:root{
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e6eaf2;

  /* AlberdiNET vibe (azules + violeta suave) */
  --primary: #1b73e8;      /* azul */
  --primary2:#8b5cf6;      /* violeta */
  --accent: #06b6d4;       /* cyan */
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --shadow2: 0 2px 10px rgba(15,23,42,.06);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Helvetica,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Links */
a{ color: inherit; text-decoration:none; }
a:hover{ text-decoration:none; }

/* Layout */
.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 10px 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 210px;
}

.brand-link{
  display:flex;
  align-items:center;
  gap: 10px;
}

.logo{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.brand-title{
  font-weight: 900;
  letter-spacing: .2px;
}

.nav{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a{
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  border: 1px solid transparent;
}

.nav a:hover{
  background: rgba(27,115,232,.08);
  border-color: rgba(27,115,232,.10);
}

.user-pill{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(27,115,232,.08);
  border: 1px solid rgba(27,115,232,.14);
  color: var(--text);
  font-weight: 600;
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 14px;
}

h1,h2,h3{
  margin: 0 0 10px;
  letter-spacing: .2px;
}
.muted{ color: var(--muted); }

/* Grid helpers */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.half{ }
.row{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Forms */
label{
  display:block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.input,
input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea{
  width:100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline: none;
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(15,23,42,.02);
}

textarea{ min-height: 90px; resize: vertical; }

.input:focus,
input:focus,
select:focus,
textarea:focus{
  border-color: rgba(27,115,232,.45);
  box-shadow: 0 0 0 4px rgba(27,115,232,.12);
}

select{
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(1em + 2px),
    calc(100% - 13px) calc(1em + 2px),
    calc(100% - 2.3em) .6em;
  background-size: 5px 5px, 5px 5px, 1px 1.8em;
  background-repeat: no-repeat;
}

/* Buttons */
.btn, button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.btn:hover, button:hover{
  background: rgba(15,23,42,.03);
}

.btn.primary{
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  border-color: rgba(27,115,232,.25);
  color: #fff;
  box-shadow: var(--shadow2);
}
.btn.primary:hover{ filter: brightness(1.02); }

.btn.danger{
  background: #fff;
  color: var(--danger);
  border-color: rgba(239,68,68,.35);
}
.btn.danger:hover{
  background: rgba(239,68,68,.06);
}

.btn.small{
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}

/* Tables */
table{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th{
  text-align:left;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

tbody td{
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:hover{
  background: rgba(27,115,232,.04);
}

.table-wrap{
  overflow:auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* Status dot */
.status-dot{
  display:inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(15,23,42,.04);
}

/* Badges */
.badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
  font-size: 12px;
}

/* Login page helpers (si tu login usa .auth-*) */
.auth-wrap{
  min-height: calc(100vh - 60px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 14px;
}

.auth-card{
  width: min(480px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.auth-logo{
  display:flex;
  justify-content:center;
  margin-bottom: 10px;
}
.auth-logo img{
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--line);
  object-fit: cover;
  background:#fff;
}

.alert{
  border: 1px solid rgba(239,68,68,.35);
  background: rgba(239,68,68,.06);
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
}

/* Footer */
.footer{
  margin-top: 18px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
  .brand{ min-width: auto; }
  .user-pill{ width: 100%; justify-content:center; margin-left:0; }
  .topbar{ flex-wrap: wrap; }
}
