/* ============================================
   Design System - ArticleHub Dashboard
   ============================================ */

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

/* --- CSS Variables --- */
:root {
  --bg-primary: #0f0e17;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(30, 30, 52, 0.6);
  --bg-card-hover: rgba(40, 40, 70, 0.8);
  --bg-sidebar: rgba(16, 15, 28, 0.95);
  --bg-input: rgba(255, 255, 255, 0.05);
  --bg-modal-overlay: rgba(0, 0, 0, 0.6);

  --text-primary: #fffffe;
  --text-secondary: #a7a9be;
  --text-muted: #6b6d80;

  --accent-primary: #7f5af0;
  --accent-primary-hover: #6b46d8;
  --accent-secondary: #2cb67d;
  --accent-warning: #f0a500;
  --accent-danger: #e53170;
  --accent-info: #39a0ed;

  --gradient-primary: linear-gradient(135deg, #7f5af0, #2cb67d);
  --gradient-accent: linear-gradient(135deg, #7f5af0, #e53170);
  --gradient-warm: linear-gradient(135deg, #f0a500, #e53170);
  --gradient-cool: linear-gradient(135deg, #39a0ed, #7f5af0);

  --border-color: rgba(127, 90, 240, 0.15);
  --border-glass: rgba(255, 255, 255, 0.08);

  --glass-bg: rgba(30, 30, 52, 0.5);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px);

  --sidebar-width: 260px;
  --sidebar-collapsed-width: 68px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(127, 90, 240, 0.15);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #f0f2f8;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-sidebar: rgba(255, 255, 255, 0.97);
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-modal-overlay: rgba(100, 100, 130, 0.45);

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aaa;

  --border-color: rgba(127, 90, 240, 0.12);
  --border-glass: rgba(0, 0, 0, 0.08);

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: 1px solid rgba(0, 0, 0, 0.08);
  --glass-blur: blur(20px);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 30px rgba(127, 90, 240, 0.08);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(127, 90, 240, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(44, 182, 125, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(229, 49, 112, 0.03) 0%, transparent 50%);
}

[data-theme="light"] .header {
  background: rgba(240, 242, 248, 0.85);
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .data-table thead {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] select.filter-select option {
  background: #ffffff;
}

[data-theme="light"] .form-select option {
  background: #ffffff;
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(127, 90, 240, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(44, 182, 125, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(229, 49, 112, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(127, 90, 240, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 90, 240, 0.5);
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: var(--bg-primary);
}

.login-bg-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  animation: floatShape 20s ease-in-out infinite;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-primary);
  top: -200px;
  right: -150px;
  animation-delay: 0s;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-secondary);
  bottom: -100px;
  left: -100px;
  animation-delay: -5s;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-danger);
  top: 40%;
  left: 50%;
  animation-delay: -10s;
}

@keyframes floatShape {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -30px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  75% {
    transform: translate(15px, 15px) scale(1.02);
  }
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 420px;
  max-width: 95%;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInUp 0.6s ease;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .brand-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-glow);
}

.login-brand h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.95rem;
  margin-top: 6px;
}

.login-error {
  color: var(--accent-danger);
  font-size: 0.8rem;
  text-align: center;
  min-height: 20px;
  margin-bottom: 4px;
}

.login-hint {
  margin-top: 24px;
  padding-top: 20px;
  border-top: var(--glass-border);
  text-align: center;
}

.login-hint p {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.hint-credentials {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hint-credentials span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'SFMono-Regular', Consolas, monospace;
  background: var(--bg-input);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow);
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .brand-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.sidebar-brand h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand .brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0 12px 8px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.nav-link:hover {
  background: rgba(127, 90, 240, 0.1);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(127, 90, 240, 0.15);
  color: var(--accent-primary);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 0 3px 3px 0;
}

.nav-link .nav-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--accent-primary);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: var(--glass-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user .user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--glass-border);
  background: rgba(15, 14, 23, 0.8);
  backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-left .header-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 4px 12px;
  border-radius: 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
}

.search-box input {
  background: var(--bg-input);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 8px 16px 8px 40px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  width: 260px;
  transition: all var(--transition-normal);
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  border-color: var(--accent-primary);
  background: rgba(127, 90, 240, 0.05);
  box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.1);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Role Badge */
.user-role-badge {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(127, 90, 240, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(127, 90, 240, 0.25);
}

.user-role-badge.role-admin {
  background: rgba(229, 49, 112, 0.12);
  color: var(--accent-danger);
  border-color: rgba(229, 49, 112, 0.25);
}

.user-role-badge.role-gestor {
  background: rgba(57, 160, 237, 0.12);
  color: var(--accent-info);
  border-color: rgba(57, 160, 237, 0.25);
}

.user-role-badge.role-redator {
  background: rgba(44, 182, 125, 0.12);
  color: var(--accent-secondary);
  border-color: rgba(44, 182, 125, 0.25);
}

/* ============================================
   VIEW PANELS
   ============================================ */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.dashboard {
  padding: 28px 32px;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(127, 90, 240, 0.25);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:nth-child(1)::before {
  background: var(--gradient-primary);
}

.stat-card:nth-child(2)::before {
  background: var(--gradient-cool);
}

.stat-card:nth-child(3)::before {
  background: var(--gradient-warm);
}

.stat-card:nth-child(4)::before {
  background: var(--gradient-accent);
}

.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-card:nth-child(1) .stat-icon {
  background: rgba(127, 90, 240, 0.15);
  color: var(--accent-primary);
}

.stat-card:nth-child(2) .stat-icon {
  background: rgba(57, 160, 237, 0.15);
  color: var(--accent-info);
}

.stat-card:nth-child(3) .stat-icon {
  background: rgba(240, 165, 0, 0.15);
  color: var(--accent-warning);
}

.stat-card:nth-child(4) .stat-icon {
  background: rgba(44, 182, 125, 0.15);
  color: var(--accent-secondary);
}

.stat-card .stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.stat-trend.up {
  color: var(--accent-secondary);
  background: rgba(44, 182, 125, 0.12);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   TABLE SECTION
   ============================================ */
.table-section {
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--glass-border);
  flex-wrap: wrap;
  gap: 12px;
}

.table-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Select filters */
select.filter-select {
  appearance: none;
  background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6d80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 7px 32px 7px 12px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

select.filter-select:hover,
select.filter-select:focus {
  border-color: rgba(127, 90, 240, 0.3);
  color: var(--text-primary);
}

select.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px rgba(127, 90, 240, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(127, 90, 240, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--accent-danger), #c0264e);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px rgba(229, 49, 112, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(229, 49, 112, 0.4);
}

.btn-secondary {
  padding: 9px 20px;
  background: var(--bg-input);
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: rgba(255, 255, 255, 0.02);
}

.data-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: var(--glass-border);
}

.data-table td {
  padding: 14px 20px;
  font-size: 0.85rem;
  border-bottom: var(--glass-border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(127, 90, 240, 0.04);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table Cell Styles */
.article-title {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-keyword {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent-primary);
  background: rgba(127, 90, 240, 0.1);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.blog-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.blog-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.pending {
  background: rgba(240, 165, 0, 0.12);
  color: var(--accent-warning);
}

.status-badge.pending::before {
  background: var(--accent-warning);
}

.status-badge.in-progress {
  background: rgba(57, 160, 237, 0.12);
  color: var(--accent-info);
}

.status-badge.in-progress::before {
  background: var(--accent-info);
}

.status-badge.review {
  background: rgba(127, 90, 240, 0.12);
  color: var(--accent-primary);
}

.status-badge.review::before {
  background: var(--accent-primary);
}

.status-badge.done {
  background: rgba(44, 182, 125, 0.12);
  color: var(--accent-secondary);
}

.status-badge.done::before {
  background: var(--accent-secondary);
}

.status-badge-active {
  background: rgba(44, 182, 125, 0.12);
  color: var(--accent-secondary);
}

.status-badge-inactive {
  background: rgba(229, 49, 112, 0.12);
  color: var(--accent-danger);
}

/* Priority */
.priority-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
}

.priority-indicator.alta {
  color: var(--accent-danger);
}

.priority-indicator.media {
  color: var(--accent-warning);
}

.priority-indicator.baixa {
  color: var(--accent-secondary);
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.priority-indicator.alta .priority-dot {
  background: var(--accent-danger);
}

.priority-indicator.media .priority-dot {
  background: var(--accent-warning);
}

.priority-indicator.baixa .priority-dot {
  background: var(--accent-secondary);
}

/* Row Actions */
.row-actions {
  display: flex;
  gap: 4px;
}

.row-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.row-action-btn:hover {
  background: rgba(127, 90, 240, 0.12);
  color: var(--accent-primary);
}

.row-action-btn.btn-delete-row:hover {
  background: rgba(229, 49, 112, 0.12);
  color: var(--accent-danger);
}

/* Empty State */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Table Footer */
.table-footer {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: all var(--transition-slow);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1.1rem;
}

.modal-close:hover {
  background: rgba(229, 49, 112, 0.15);
  color: var(--accent-danger);
}

.modal-body {
  padding: 24px 28px;
}

.modal-footer {
  padding: 0 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--accent-danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.12);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6d80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

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

/* Detail Modal */
.detail-modal .modal {
  width: 620px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  background: var(--bg-input);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: var(--glass-border);
}

.detail-item .detail-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.detail-item .detail-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.detail-instructions {
  background: var(--bg-input);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: var(--glass-border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.detail-status-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-step {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-muted);
  border: var(--glass-border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-step.current {
  background: rgba(127, 90, 240, 0.15);
  color: var(--accent-primary);
  border-color: rgba(127, 90, 240, 0.3);
}

.status-step.completed {
  background: rgba(44, 182, 125, 0.12);
  color: var(--accent-secondary);
  border-color: rgba(44, 182, 125, 0.2);
}

.status-step.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.status-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Role indicator in user table */
.role-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.role-tag.admin {
  background: rgba(229, 49, 112, 0.12);
  color: var(--accent-danger);
}

.role-tag.gestor {
  background: rgba(57, 160, 237, 0.12);
  color: var(--accent-info);
}

.role-tag.redator {
  background: rgba(44, 182, 125, 0.12);
  color: var(--accent-secondary);
}

/* Published Status Badge */
.status-badge.published {
  background: rgba(0, 210, 190, 0.12);
  color: #00d2be;
}

.status-badge.published::before {
  background: #00d2be;
}

.status-step.published-step {
  background: rgba(0, 210, 190, 0.1);
  color: #00d2be;
  border-color: rgba(0, 210, 190, 0.2);
}

.status-step.published-step.current {
  background: rgba(0, 210, 190, 0.2);
  color: #00d2be;
  border-color: rgba(0, 210, 190, 0.4);
}

/* ============================================
   CHANGE HISTORY TIMELINE
   ============================================ */
.history-timeline {
  position: relative;
  padding-left: 24px;
  max-height: 260px;
  overflow-y: auto;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
  border-radius: 1px;
}

.history-item {
  position: relative;
  padding-bottom: 16px;
}

.history-item:last-child {
  padding-bottom: 0;
}

.history-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-secondary);
  z-index: 1;
}

.history-item.action-create::before {
  background: var(--accent-secondary);
}

.history-item.action-status_change::before {
  background: var(--accent-info);
}

.history-item.action-published::before {
  background: #00d2be;
}

.history-item.action-edit::before {
  background: var(--accent-warning);
}

.history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.history-user {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.history-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.history-action {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.history-change {
  display: inline-block;
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 6px;
  margin: 2px 0;
}

.history-change .field-name {
  color: var(--accent-primary);
  font-weight: 600;
}

.history-change .old-val {
  color: var(--accent-danger);
  text-decoration: line-through;
  opacity: 0.7;
}

.history-change .new-val {
  color: var(--accent-secondary);
  font-weight: 600;
}

/* ============================================
   PUBLISH VALIDATION
   ============================================ */
.publish-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.publish-url-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: all var(--transition-fast);
}

.publish-url-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.12);
}

.publish-url-input.valid {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(44, 182, 125, 0.12);
}

.publish-url-input.invalid {
  border-color: var(--accent-danger);
  box-shadow: 0 0 0 3px rgba(229, 49, 112, 0.12);
}

.publish-host-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.publish-host-hint strong {
  color: var(--accent-info);
}

.publish-status {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 8px;
}

.publish-status.show {
  display: flex;
}

.publish-status.loading {
  background: rgba(57, 160, 237, 0.1);
  color: var(--accent-info);
  border: 1px solid rgba(57, 160, 237, 0.2);
}

.publish-status.success {
  background: rgba(44, 182, 125, 0.1);
  color: var(--accent-secondary);
  border: 1px solid rgba(44, 182, 125, 0.2);
}

.publish-status.error {
  background: rgba(229, 49, 112, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(229, 49, 112, 0.2);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Published link display */
.published-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 210, 190, 0.08);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 210, 190, 0.15);
  margin-top: 8px;
}

.published-link a {
  color: #00d2be;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  word-break: break-all;
}

.published-link a:hover {
  text-decoration: underline;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card {
  animation: fadeInUp 0.5s ease forwards;
}

.stat-card:nth-child(1) {
  animation-delay: 0s;
}

.stat-card:nth-child(2) {
  animation-delay: 0.08s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.16s;
}

.stat-card:nth-child(4) {
  animation-delay: 0.24s;
}

.table-section {
  animation: fadeInUp 0.5s ease 0.3s forwards;
  opacity: 0;
}

/* ============================================
   COLLAPSIBLE SIDEBAR
   ============================================ */
.sidebar {
  transition: width var(--transition-slow);
}

.sidebar-toggle {
  width: 28px;
  height: 28px;
  position: absolute;
  top: 28px;
  right: -14px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  border: 2px solid var(--bg-primary);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.1);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand h1,
.sidebar.collapsed .brand-sub,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-link span:not(.nav-icon),
.sidebar.collapsed .nav-link .nav-badge,
.sidebar.collapsed .sidebar-user .user-info {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 24px 12px;
}

.sidebar.collapsed .sidebar-brand>div:last-child {
  display: none;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}

.sidebar.collapsed .nav-link .nav-icon {
  margin: 0;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 16px 12px;
}

.sidebar.collapsed .sidebar-user .user-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.75rem;
}

.main-content {
  transition: margin-left var(--transition-slow);
}

body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: var(--glass-border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: rgba(127, 90, 240, 0.12);
  color: var(--accent-primary);
  transform: rotate(20deg);
}

/* ============================================
   NOTIFICATION BELL & DROPDOWN
   ============================================ */
.notif-wrapper {
  position: relative;
}

.notif-bell {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: var(--glass-border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  position: relative;
}

.notif-bell:hover {
  background: rgba(127, 90, 240, 0.12);
  color: var(--accent-primary);
}

.notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
}

[data-theme="light"] .notif-count {
  border-color: var(--bg-primary);
}

.notif-count:empty,
.notif-count[data-count="0"] {
  display: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 420px;
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}

.notif-dropdown.open {
  display: block;
  animation: fadeInUp 0.2s ease;
}

.notif-dropdown-header {
  padding: 14px 18px;
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-dropdown-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.notif-mark-all {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.notif-mark-all:hover {
  text-decoration: underline;
}

.notif-list {
  max-height: 340px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 18px;
  border-bottom: var(--glass-border);
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.notif-item:hover {
  background: rgba(127, 90, 240, 0.04);
}

.notif-item.unread {
  background: rgba(127, 90, 240, 0.06);
}

.notif-item.unread::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-item-body {
  flex: 1;
  min-width: 0;
}

.notif-item-text {
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.notif-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   MESSAGES VIEW
   ============================================ */
.messages-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.msg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.msg-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.msg-tab {
  padding: 7px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.msg-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.msg-list {
  display: flex;
  flex-direction: column;
}

.msg-item {
  padding: 14px 20px;
  border-bottom: var(--glass-border);
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 14px;
}

.msg-item:hover {
  background: rgba(127, 90, 240, 0.04);
}

.msg-item.unread {
  background: rgba(127, 90, 240, 0.05);
}

.msg-item.unread .msg-subject {
  font-weight: 700;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  flex-shrink: 0;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-subject {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.msg-from {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.msg-unread-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Compose modal extras */
.compose-recipient {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Message detail */
.msg-detail-header {
  padding: 16px 20px;
  border-bottom: var(--glass-border);
}

.msg-detail-subject {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.msg-detail-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

.msg-detail-body {
  padding: 20px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ============================================
   RESPONSIVE
   ============================================ */
.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: var(--glass-border);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-toggle {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-box input {
    width: 180px;
  }

  .modal {
    width: 95%;
    margin: 0 16px;
  }

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

  .data-table {
    display: block;
    overflow-x: auto;
  }
}

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

  .header {
    padding: 0 16px;
  }

  .dashboard {
    padding: 20px 16px;
  }

  .table-actions {
    flex-wrap: wrap;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}