/* painel-pedro · preto e branco */

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

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #a1a1aa;
  --text: #18181b;
  --text-dim: #52525b;
  --text-mute: #a1a1aa;
  --accent: #000000;
  --danger: #dc2626;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
}

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

[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ============= LOGIN ============= */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 48px 36px;
  text-align: center;
}

.login-logo { margin-bottom: 24px; }
.login-logo img { display: block; margin: 0 auto; }

.login-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.login-sub {
  color: var(--text-mute);
  font-size: 13px;
  margin-bottom: 32px;
  letter-spacing: 0.5px;
}

.login-error {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--danger);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: left;
}

.login-form { text-align: left; }
.field {
  display: block;
  margin-bottom: 16px;
}
.field span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--text-dim);
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  transition: border-color .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--text);
}

.field-password { position: relative; }
.field-password input { padding-right: 44px; }
.senha-toggle {
  position: absolute;
  right: 8px;
  top: 26px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}
.senha-toggle:hover { color: var(--text); }

.login-footer {
  margin-top: 32px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ============= BUTTONS ============= */
.btn-primary, .btn-secondary, .btn-danger, .btn-link {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity .15s, transform .1s;
}
.btn-primary:active, .btn-secondary:active, .btn-danger:active { transform: translateY(1px); }
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover { opacity: 0.85; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  width: 100%;
  padding: 14px 20px;
  margin-top: 8px;
}
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--text);
}
.btn-danger {
  background: var(--bg);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-link {
  background: none;
  border: none;
  color: var(--text-dim);
  text-decoration: underline;
  padding: 6px 8px;
  font-size: 13px;
}

/* ============= TOPBAR ============= */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.welcome {
  font-size: 13px;
  color: var(--text-dim);
}

.storage-bar {
  position: relative;
  height: 4px;
  background: var(--surface-2);
}
.storage-fill {
  height: 100%;
  background: var(--text);
  transition: width .3s;
}
.storage-label {
  position: absolute;
  top: 8px;
  right: 24px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
}

/* ============= MAIN ============= */
.main {
  max-width: 1280px;
  margin: 32px auto;
  padding: 0 24px 80px;
}

/* ============= UPLOAD ZONE ============= */
.upload-zone {
  border: 2px dashed var(--border-strong);
  background: var(--surface);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 32px;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--text);
  background: var(--bg);
}
.upload-icon {
  font-size: 32px;
  font-weight: 300;
  color: var(--text-mute);
  margin-bottom: 12px;
}
.upload-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.upload-sub {
  font-size: 13px;
  color: var(--text-mute);
}

.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upload-progress-bar {
  height: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--text);
  width: 0%;
  transition: width .2s;
}
.upload-progress-text {
  font-size: 13px;
  color: var(--text-dim);
}

/* ============= FILTERS ============= */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--text); color: var(--text); }
.filter-chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ============= BULK BAR ============= */
.bulk-bar {
  background: var(--text);
  color: var(--bg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  position: sticky;
  top: 60px;
  z-index: 50;
}
.bulk-count {
  font-size: 14px;
  font-weight: 600;
}
.bulk-actions { display: flex; gap: 8px; }
.bulk-bar .btn-secondary {
  background: var(--bg);
  color: var(--text);
  padding: 8px 14px;
  font-size: 12px;
}
.bulk-bar .btn-danger {
  background: var(--bg);
  color: var(--danger);
  border-color: var(--bg);
  padding: 8px 14px;
  font-size: 12px;
}
.bulk-bar .btn-link {
  color: var(--bg);
  opacity: 0.8;
}

/* ============= GRID ============= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  overflow: hidden;
}
.tile:hover {
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tile.selected {
  border-color: var(--text);
  border-width: 2px;
}

.tile-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--text);
}

.tile-img {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
  position: relative;
}

.tile-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  background: rgba(0,0,0,0.2);
}

.tile-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-meta {
  font-size: 11px;
  color: var(--text-mute);
}

/* ============= EMPTY ============= */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-mute);
}
.empty p { font-size: 16px; margin-bottom: 8px; color: var(--text-dim); }
.empty-sub { font-size: 13px !important; }

/* ============= LIGHTBOX ============= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}
.lightbox-content {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 80vh;
  display: block;
}

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 48px;
  height: 48px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255,255,255,0.1);
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox-actions {
  position: absolute;
  bottom: 30px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.lightbox-actions .btn-secondary {
  background: white;
  color: var(--text);
  border: none;
}
.lightbox-actions .btn-danger {
  background: transparent;
  color: white;
  border: 1px solid white;
}

/* ============= MOBILE ============= */
@media (max-width: 720px) {
  .topbar-inner { padding: 12px 16px; }
  .main { padding: 0 16px 60px; margin: 20px auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .upload-zone { padding: 30px 16px; }
  .filter-row { gap: 10px; }
  .bulk-bar {
    flex-wrap: wrap;
    top: 56px;
  }
  .lightbox-prev, .lightbox-next { display: none; }
  .lightbox-actions { bottom: 16px; }
  .welcome { display: none; }
  .storage-label { right: 16px; font-size: 10px; }
}
