/* Centrica Portal — paleta y estilos */

:root {
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --hover: #eff6ff;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --success: #16a34a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.18);
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ===== Login ===== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -2;
}
.login-bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.55) 0%, rgba(30, 58, 138, 0.65) 100%);
  z-index: -1;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 36px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo {
  max-width: 280px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}
.login-tagline {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}
.login-card label {
  display: block;
  text-align: left;
  margin-bottom: 14px;
}
.login-card label span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.login-card input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}
.login-card button {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.login-card button:hover:not(:disabled) { background: var(--primary-dark); }
.login-card button:disabled { opacity: 0.6; cursor: not-allowed; }
.login-footer {
  margin: 24px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.error-msg {
  color: var(--danger);
  background: var(--danger-bg);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 12px 0 0;
  text-align: left;
}

/* ===== App ===== */

.app-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.header-logo {
  height: 44px;
  width: auto;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-info {
  font-size: 14px;
  color: var(--text-muted);
}
.user-info strong { color: var(--text); }

.app-main {
  flex: 1;
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.breadcrumbs {
  font-size: 15px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 32px;
}
.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.breadcrumbs a:hover { background: var(--hover); }
.breadcrumbs .sep {
  color: var(--text-muted);
  margin: 0 2px;
}
.breadcrumbs .current {
  padding: 4px 8px;
  color: var(--text);
  font-weight: 600;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.btn-primary, .btn-secondary, .btn-ghost {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--hover); border-color: var(--primary-light); }
.btn-ghost-small {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 6px;
}

.drop-zone {
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px dashed transparent;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--hover);
}

.files-table {
  width: 100%;
  border-collapse: collapse;
}
.files-table th {
  background: #f1f5f9;
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}
.files-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.files-table tr:last-child td { border-bottom: none; }
.files-table tr:hover td { background: var(--hover); }
.files-table .col-size, .files-table .col-mod { width: 150px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.files-table .col-actions { width: 90px; text-align: right; }
.files-table .empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-style: italic;
}

.fs-name {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}
.fs-name:hover { color: var(--primary); }
.fs-name .icon {
  font-size: 18px;
  width: 22px;
  display: inline-block;
  text-align: center;
}
.fs-name.dir { font-weight: 600; }
.fs-name.dir .icon { color: var(--primary); }

.row-action {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: 5px;
}
.row-action:hover { background: var(--danger-bg); color: var(--danger); }
.row-action.download:hover { background: var(--hover); color: var(--primary); }

/* ===== Upload status ===== */

.upload-status {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-height: 50vh;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.upload-status-header {
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.upload-status-header .btn-ghost-small { color: rgba(255,255,255,0.8); }
.upload-status-header .btn-ghost-small:hover { color: white; }
#upload-list {
  overflow-y: auto;
  padding: 8px;
}
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.upload-item:last-child { border-bottom: none; }
.upload-item .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-item .status {
  font-size: 12px;
  font-weight: 600;
}
.upload-item.ok .status { color: var(--success); }
.upload-item.err .status { color: var(--danger); }
.upload-item.pending .status { color: var(--text-muted); }
.upload-item.uploading .status { color: var(--primary); }

/* ===== Modal ===== */

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 92%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin: 0 0 16px; color: var(--primary-dark); }
.modal label { display: block; }
.modal label span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 7px;
  font-size: 15px;
  font-family: inherit;
}
.modal input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}
.modal-actions {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 720px) {
  .app-header { padding: 10px 14px; }
  .header-logo { height: 36px; }
  .app-main { padding: 14px; }
  .files-table .col-size, .files-table .col-mod { display: none; }
  .upload-status { right: 12px; left: 12px; width: auto; bottom: 12px; }
}

/* Move bar (cut/paste) */
.move-bar {
  margin: 12px 0;
  padding: 10px 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.move-bar strong { color: #1d4ed8; }
.move-bar-actions { display: flex; gap: 8px; }
tr.row-cut { opacity: 0.55; background: #fef9c3; }
tr.row-cut td { font-style: italic; }
.row-action.view, .row-action.cut { margin-right: 4px; }
