@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #060d1c;
  --surface: #0e1526;
  --surface-2: #172138;
  --border: rgba(255,255,255,0.1);
  --border-strong: rgba(255,255,255,0.2);
  --text-heading: #eef2f7;
  --text-body: #959fae;
  --text-muted: #6b7592;
  --gold: #f2b036;
  --gold-soft: rgba(242,176,54,0.15);
  --gold-dark: #b8801f;
  --danger: #e0645a;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-body);
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; color: var(--text-heading); font-weight: 600; }

a { color: inherit; text-decoration: none; }

button { font-family: 'Inter', sans-serif; }

/* ===== Login ===== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  width: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(242,176,54,0.08), transparent 60%), var(--bg);
}

.login-box {
  background: var(--surface);
  padding: 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-box h1 { font-size: 28px; margin-bottom: 8px; }

.subtitle { color: var(--text-body); font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-body);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-heading);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

/* ===== Buttons ===== */
.btn-primary, .workspace-btn {
  display: inline-block;
  background: var(--gold);
  color: #0a1121;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  padding: 13px 28px;
  cursor: pointer;
  box-shadow: 0 16px 40px -16px rgba(242,176,54,0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.btn-primary:hover, .workspace-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px -14px rgba(242,176,54,0.7);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text-heading);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 12px 26px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  display: inline-block;
  background: rgba(224,100,90,0.1);
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(224,100,90,0.35);
  border-radius: 999px;
  padding: 12px 26px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover { background: rgba(224,100,90,0.2); }

/* ===== Layout shells ===== */
.admin-container, .client-container {
  display: flex;
  min-height: 100vh;
}

.admin-nav, .client-nav {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 32px 20px;
  position: relative;
}

.admin-nav::before, .client-nav::before {
  content: '';
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-soft), transparent);
}

.nav-brand { margin-bottom: 36px; padding: 0 8px; }

.nav-brand h2 {
  font-size: 21px;
  letter-spacing: 0.01em;
}

.client-email {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 8px;
  margin-top: -30px;
  margin-bottom: 30px;
  word-break: break-all;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-menu li:has(.logout) {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.nav-link {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text-heading);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(242,176,54,0.16), rgba(242,176,54,0.04));
  color: var(--gold);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-link.logout {
  color: var(--danger);
}

.nav-link.logout:hover {
  background: rgba(224,100,90,0.1);
  color: var(--danger);
}

.admin-main, .client-main {
  flex: 1;
  padding: 40px 48px;
  overflow-y: auto;
}

.client-content { max-width: 900px; }

/* ===== Sections ===== */
.section-content { display: none; }
.section-content.active { display: block; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.card h3 {
  font-size: 14px;
  color: var(--text-body);
  font-weight: 500;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.big-number {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  color: var(--gold);
  font-weight: 600;
}

.form-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-top: 24px;
  max-width: 560px;
}

.clients-list, .clients-table {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.client-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.client-item:last-child { border-bottom: none; }

.project-card, .workspace-card, .generic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.project-status { display: flex; align-items: center; gap: 10px; margin-top: 14px; }

.status-badge {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(242,176,54,0.35);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
}

.generic-logo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 14px;
}

.section-info, .boveda-section, .planificador-section {
  margin-top: 24px;
}

.files-list, .tasks-list, .tasks-container, .messages-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 16px;
}

/* ===== Workspace Calendar (Metricool-style) ===== */
.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.workspace-header .calendar-nav {
  flex-wrap: wrap;
}

.workspace-header .btn-primary {
  white-space: nowrap;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-nav button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-heading);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.calendar-nav button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.calendar-month-label {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--text-heading);
  min-width: 200px;
  text-align: center;
  text-transform: capitalize;
}

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

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding-bottom: 8px;
}

.calendar-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 110px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.calendar-day:hover {
  border-color: var(--border-strong);
}

.calendar-day.other-month {
  opacity: 0.35;
}

.calendar-day.today {
  border-color: var(--gold);
}

.calendar-day-number {
  font-size: 13px;
  color: var(--text-body);
  font-weight: 600;
}

.event-chip {
  background: var(--surface-2);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  color: var(--text-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-chip.estado-publicado {
  border-left-color: #5bc27a;
}

.event-chip.estado-aprobado {
  border-left-color: var(--gold);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,13,28,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-heading);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.upload-zone {
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  margin-top: 12px;
  cursor: pointer;
}

.upload-zone h4 {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 8px;
}

.media-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-body);
}

.client-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-heading);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
}
