/* ==============================================================================
   KORI FILMS CONTROL — Global Design System & Variables
   Dominio: control.korifilms.cl
   ============================================================================== */

:root {
  --bg-body: #090b10;
  --bg-surface: #11141d;
  --bg-surface-elevated: #171b26;
  --bg-surface-hover: #1e2332;
  
  --border-subtle: #1e2433;
  --border-medium: #2a3246;
  --border-focus: #10b981;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Brand colors */
  --accent-kori: #6366f1;         /* Indigo / Violeta Kori */
  --accent-kori-glow: rgba(99, 102, 241, 0.25);
  --accent-matcha: #10b981;       /* Verde Matcha Tencha */
  --accent-matcha-glow: rgba(16, 185, 129, 0.25);
  --accent-matcha-soft: #064e3b;
  
  /* Status */
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #06b6d4;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);
}

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

/* Ocultar cualquier widget o globo de Netlify */
[data-netlify-drawer],
#netlify-drawer,
.netlify-drawer-container,
[class*="netlify-drawer"],
[class*="netlify-feedback"],
iframe[src*="netlify"],
div[id*="netlify"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Helpers de visibilidad */
.hidden {
  display: none !important;
}

/* ------------------------------------------------------------------------------
   NAVBAR & CABECERA GLOBAL
   ------------------------------------------------------------------------------ */

.navbar {
  background: rgba(17, 20, 29, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-matcha) 0%, var(--accent-kori) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  box-shadow: 0 0 16px var(--accent-matcha-glow);
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-matcha);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-surface-elevated);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.user-avatar-circle {
  width: 24px;
  height: 24px;
  background: var(--border-medium);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-email-text {
  font-size: 0.85rem;
  color: var(--text-main);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------------------
   BOTONES Y CONTROLES
   ------------------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-matcha) 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-matcha-glow);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--text-dim);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.btn-outline-danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-outline-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.btn-icon-danger {
  background: transparent;
  border: none;
  color: #f87171;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ------------------------------------------------------------------------------
   BADGES & PILLS
   ------------------------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-superadmin {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-client {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-inactive {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-dim);
}

/* ------------------------------------------------------------------------------
   MODAL BACKDROP Y VENTANA
   ------------------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 500;
}

.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  animation: modalIn 200ms ease;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ------------------------------------------------------------------------------
   CAMPOS DE FORMULARIO
   ------------------------------------------------------------------------------ */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-matcha-glow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ------------------------------------------------------------------------------
   TOAST NOTIFICATIONS
   ------------------------------------------------------------------------------ */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-normal);
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-left: 4px solid var(--status-success);
}

.toast-warning {
  border-left: 4px solid var(--status-warning);
}

.toast-error {
  border-left: 4px solid var(--status-danger);
}

.toast-info {
  border-left: 4px solid var(--status-info);
}
