/* ═══════════════════════════════════════════
   VQ Arquitectura — Zona Clientes
   ═══════════════════════════════════════════ */

:root {
  --navy:      #1e2d4a;
  --navy-l:    #2a3d62;
  --gold:      #b8952a;
  --gold-l:    #d4ae52;
  --cream:     #f5f3ee;
  --cream-d:   #ece9e1;
  --white:     #ffffff;
  --text:      #1a1a2e;
  --text-mid:  #4a4a5a;
  --text-light:#7a7a8a;
  --danger:    #c0392b;
  --ok:        #2d7a4f;

  --font-d: 'Cormorant Garamond', Georgia, serif;
  --font-b: 'DM Sans', system-ui, sans-serif;
  --radius: 6px;
  --shadow: 0 4px 24px rgba(30,45,74,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font-b); font-weight: 300; color: var(--text); background: var(--cream); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
input, button, select, textarea { font-family: inherit; }

/* ── LOGIN ──────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}

.login-wrap {
  background: var(--white);
  border-radius: 12px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  text-align: center;
}

.login-logo img {
  height: 56px;
  margin-bottom: 1.5rem;
}

.login-title {
  font-family: var(--font-d);
  font-size: 2rem;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: .4rem;
}

.login-subtitle {
  font-size: .88rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.login-form { text-align: left; }

.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: .35rem;
}
.field input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--cream-d);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--cream);
  transition: border-color .2s;
}
.field input:focus { outline: none; border-color: var(--gold); background: var(--white); }

.btn-login {
  width: 100%;
  padding: .9rem;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .2s;
}
.btn-login:hover { background: var(--navy-l); }

.login-back {
  display: block;
  margin-top: 1.5rem;
  font-size: .82rem;
  color: var(--text-light);
  transition: color .2s;
}
.login-back:hover { color: var(--gold); }

/* ── HEADER PANEL ───────────────────────── */
.cp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 2rem;
  box-shadow: 0 2px 16px rgba(0,0,0,.2);
}

.cp-logo img { height: 42px; filter: brightness(0) invert(1); }

.cp-header__right { display: flex; align-items: center; gap: 1.25rem; }

.cp-user { font-size: .88rem; color: rgba(255,255,255,.75); }

.cp-badge {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--white);
  padding: .2rem .6rem;
  border-radius: 20px;
}

.cp-logout {
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.2);
  padding: .35rem .9rem;
  border-radius: var(--radius);
  transition: color .2s, border-color .2s;
}
.cp-logout:hover { color: var(--white); border-color: rgba(255,255,255,.6); }

/* ── LAYOUT ─────────────────────────────── */
.cp-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 62px);
}

/* ── SIDEBAR ────────────────────────────── */
.cp-sidebar {
  background: var(--white);
  border-right: 1px solid var(--cream-d);
  padding: 1.75rem 1.25rem;
  overflow-y: auto;
}

.cp-sidebar__title {
  font-family: var(--font-d);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--cream-d);
}

.cp-sidebar__subtitle {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .75rem;
  margin-top: 1.75rem;
}

.project-list { display: flex; flex-direction: column; gap: .35rem; }

.project-list__item a {
  display: block;
  padding: .65rem .9rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.project-list__item a:hover { background: var(--cream); }
.project-list__item.active a {
  background: var(--cream);
  border-color: var(--gold);
}

.project-list__name { display: block; font-size: .9rem; font-weight: 400; color: var(--text); }
.project-list__date { display: block; font-size: .75rem; color: var(--text-light); margin-top: .15rem; }

/* ── MAIN ───────────────────────────────── */
.cp-main { padding: 2rem 2.5rem; overflow-y: auto; }

.cp-main__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.cp-main__title {
  font-family: var(--font-d);
  font-size: 2rem;
  font-weight: 400;
  color: var(--navy);
}
.cp-main__date { font-size: .85rem; color: var(--text-light); margin-top: .25rem; }

.cp-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text-light);
  font-size: 1rem;
}

.cp-empty { color: var(--text-light); font-size: .9rem; padding: .5rem 0; }
.cp-empty--sm { font-size: .82rem; }

/* ── ALERTS ─────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1.25rem;
}
.alert--error { background: #fdf0ef; border: 1px solid #e8a09a; color: var(--danger); }
.alert--ok    { background: #edf7f1; border: 1px solid #7ec99a; color: var(--ok); }
.alert--info  { background: #fdf8ed; border: 1px solid var(--gold-l); color: #7a5a10; }

/* ── DRIVE BUTTON ───────────────────────── */
.btn-drive {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--gold);
  color: var(--white);
  padding: .6rem 1.2rem;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .06em;
  transition: background .2s;
  white-space: nowrap;
}
.btn-drive svg { width: 1rem; height: 1rem; }
.btn-drive:hover { background: var(--gold-l); }

/* ── FILES TABLE ────────────────────────── */
.files-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.check-all-wrap {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .85rem;
  color: var(--text-mid);
  cursor: pointer;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .06em;
  cursor: pointer;
  border: none;
  transition: background .2s, opacity .2s;
}
.btn-action svg { width: .95rem; height: .95rem; }
.btn-action:disabled { opacity: .4; cursor: not-allowed; }

.btn-action--download { background: var(--navy); color: var(--white); }
.btn-action--download:hover:not(:disabled) { background: var(--navy-l); }

.btn-action--danger { background: var(--danger); color: var(--white); }
.btn-action--danger:hover { background: #a93226; }

.files-table-wrap { overflow-x: auto; }

.files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.files-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--cream-d);
}
.files-table td {
  padding: .75rem;
  border-bottom: 1px solid var(--cream-d);
  vertical-align: middle;
}
.files-table tr:hover td { background: var(--cream); }

.col-check { width: 36px; }
.col-name {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 400;
  color: var(--navy);
}
.file-icon { width: 1rem; height: 1rem; color: var(--gold); flex-shrink: 0; }

.btn-replace {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: var(--cream);
  border: 1px solid var(--cream-d);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.btn-replace svg { width: .9rem; height: .9rem; color: var(--navy); }
.btn-replace:hover { background: var(--cream-d); border-color: var(--gold); }

/* ── ADMIN: mini forms ──────────────────── */
.sidebar-section { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--cream-d); }

.mini-form { display: flex; flex-direction: column; gap: .5rem; }

.mini-input, .mini-input-date {
  width: 100%;
  padding: .55rem .8rem;
  border: 1.5px solid var(--cream-d);
  border-radius: var(--radius);
  font-size: .85rem;
  background: var(--cream);
  transition: border-color .2s;
}
.mini-input:focus, .mini-input-date:focus { outline: none; border-color: var(--gold); }

.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .9rem;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-mini:hover { background: var(--navy-l); }
.btn-mini svg { width: .85rem; height: .85rem; }

.btn-mini--upload {
  background: var(--cream);
  color: var(--navy);
  border: 1px solid var(--cream-d);
}
.btn-mini--upload:hover { border-color: var(--gold); background: var(--cream-d); }

/* ── ADMIN: project cards ───────────────── */
.cp-layout--admin .cp-main { padding: 1.75rem 2rem; }

.admin-section { margin-bottom: 2rem; }

.admin-section__title {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.project-card-admin {
  background: var(--white);
  border: 1px solid var(--cream-d);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.project-card-admin__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .85rem;
}
.project-card-admin__header strong { font-size: 1rem; font-weight: 500; color: var(--navy); }

.badge-date {
  display: inline-block;
  font-size: .75rem;
  color: var(--text-light);
  margin-left: .75rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .8rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  transition: background .2s;
}
.btn-icon--danger { color: var(--danger); }
.btn-icon--danger:hover { background: #fdf0ef; }

.drive-form, .request-form { margin-bottom: .75rem; }
.drive-row, .add-project-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.drive-input {
  flex: 1;
  min-width: 0;
  padding: .5rem .8rem;
  border: 1.5px solid var(--cream-d);
  border-radius: var(--radius);
  font-size: .85rem;
  background: var(--cream);
  transition: border-color .2s;
}
.drive-input:focus { outline: none; border-color: var(--gold); }

.admin-files { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--cream-d); }
.admin-files__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}
.admin-files__label { font-size: .78rem; font-weight: 500; color: var(--text-mid); }

.admin-file-list { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .75rem; }
.admin-file-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
  padding: .3rem .5rem;
  border-radius: 4px;
}
.admin-file-list li:hover { background: var(--cream); }
.admin-file-name { flex: 1; color: var(--text); }
.admin-file-size { color: var(--text-light); font-size: .78rem; }

.requested-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
  align-items: center;
  font-size: .78rem;
  color: var(--text-light);
}
.requested-tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #fdf8ed;
  border: 1px solid var(--gold-l);
  color: #7a5a10;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .78rem;
}
.tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: .7rem;
  padding: 0;
  line-height: 1;
}

.add-project-form {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--cream-d);
}

code {
  background: var(--cream);
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .85rem;
}

/* ── Iconos de acción ───────────────────────── */
.col-actions { display: flex; gap: .35rem; align-items: center; }
.col-by { font-size: .8rem; color: var(--text-light); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 4px;
  background: var(--cream);
  border: 1px solid var(--cream-d);
  cursor: pointer;
  color: var(--navy);
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.icon-btn svg { width: .85rem; height: .85rem; }
.icon-btn:hover { background: var(--cream-d); border-color: var(--gold); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: #fdf0ef; border-color: var(--danger); }

.admin-file-actions { display: flex; gap: .3rem; align-items: center; margin-left: auto; }
.admin-file-by { font-size: .75rem; color: var(--text-light); }
.admin-file-list li { flex-wrap: wrap; }

/* ── Modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,45,74,.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--white);
  border-radius: 10px;
  padding: 2rem;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal__title {
  font-family: var(--font-d);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--navy);
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-light);
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: 4px;
  transition: background .15s;
}
.modal__close:hover { background: var(--cream); color: var(--text); }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin-bottom: 1.25rem;
}

.field--full { grid-column: 1 / -1; }

.modal__form .field label {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: .3rem;
}
.modal__form .field small { font-size: .7rem; text-transform: none; letter-spacing: 0; color: var(--text-light); }

.btn-mini--full { width: 100%; justify-content: center; padding: .7rem; }

.btn-action--edit {
  background: var(--cream);
  color: var(--navy);
  border: 1px solid var(--cream-d);
}
.btn-action--edit:hover { background: var(--cream-d); border-color: var(--gold); }

@media (max-width: 480px) {
  .modal-grid { grid-template-columns: 1fr; }
}

/* ── Botón subir (toolbar cliente) ────────── */
.btn-action--upload {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1rem;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .05em;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  transition: background .2s, color .2s;
}
.btn-action--upload svg { width: 15px; height: 15px; }
.btn-action--upload:hover { background: var(--gold); color: var(--white); }

.icon-btn--danger { color: var(--danger); }
.icon-btn--danger:hover { background: #fff0f0; color: var(--danger); }

.btn-mini--drive {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #1a73e8;
  color: #fff;
  border: none;
  text-decoration: none;
}
.btn-mini--drive:hover { background: #1557b0; color: #fff; }

/* ── LOGIN: extras ──────────────────────── */
.login-forgot {
  display: block;
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--gold);
  transition: color .2s;
}
.login-forgot:hover { color: var(--gold-l); }

.alert--locked {
  background: #fff0f0;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  text-align: left;
}

/* ── DESBLOQUEAR USUARIO ─────────────────── */
.btn-action--unlock {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}
.btn-action--unlock:hover { background: #ffc107; color: var(--white); }

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 768px) {
  .cp-layout { grid-template-columns: 1fr; }
  .cp-sidebar { border-right: none; border-bottom: 1px solid var(--cream-d); }
  .cp-main { padding: 1.25rem; }
  .cp-header { padding: .75rem 1rem; }
  .cp-user { display: none; }
}
