/* ============================================================
   Admin Dashboard - Modern Premium Design System
   Desa Temesi Custom Theme
   Clean, Lightweight, and Anti-Adblock Compliant (Prefix: tm-)
   ============================================================ */

/* 1. RESET & BASE
   ============================================================ */
:root {
  --tm-header-h: 72px;
}

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

body {
  font-family: var(--tm-font-body);
  background: var(--tm-bg);
  color: var(--tm-text);
  overflow-x: hidden;
}

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

/* 2. ADMIN SHELL & LAYOUT (Premium Flex Structure)
   ============================================================ */
.desa-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* 3. SIDEBAR (Global styles applied via core-components.css)
   ============================================================ */
.desa-sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
}

/* 4. HEADER (Modern Floating Glass)
   ============================================================ */
.desa-header {
  height: var(--tm-header-h);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--tm-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-left { display: flex; align-items: center; gap: 1rem; }

.sidebar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--tm-white);
  border: 1px solid var(--tm-border);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1000;
  transition: var(--tm-transition);
}

.sidebar-toggle.active {
  background: var(--tm-primary);
  color: white;
  border-color: var(--tm-primary);
  z-index: 10001; /* Above the sidebar (9999) */
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* 5. MAIN CONTENT
   ============================================================ */
.desa-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--tm-bg);
}

.desa-content {
  padding: 2rem 3.5rem;
  width: 100%;
}

.desa-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--tm-primary);
  margin-bottom: 2rem;
  letter-spacing: -0.03em;
}

/* 6. STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--tm-white);
  padding: 2rem;
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--tm-border);
  transition: var(--tm-transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.stat-card h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tm-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.stat-card .number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--tm-primary);
  font-family: var(--tm-font-head);
}

.stat-card i {
  position: absolute;
  right: -10px;
  bottom: -10px;
  font-size: 5rem;
  opacity: 0.03;
  color: var(--tm-primary);
}

/* 7. TABLES (Modern Minimalist)
   ============================================================ */
.desa-table-wrapper {
  background: var(--tm-white);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--tm-border);
  overflow: hidden;
}

.desa-table { width: 100%; border-collapse: collapse; }

.desa-table th {
  background: var(--tm-bg);
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--tm-muted);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--tm-border);
}

.desa-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  color: var(--tm-text);
  font-size: 0.95rem;
}

.desa-table tr:hover td { background: var(--tm-primary-light); }

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

.table-actions { display: flex; gap: 0.5rem; }

/* 8. FORM & PANELS (Global styles applied via core-components.css)
   ============================================================ */

/* 9. LOGIN PAGE (Modern Gradient)
   ============================================================ */
.desa-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 0% 0%, #2d5a27 0%, transparent 50%),
              radial-gradient(circle at 100% 100%, #1e3a1e 0%, #0f172a 100%);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  font-family: var(--tm-font-body);
}

.desa-login-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: var(--tm-primary);
  filter: blur(120px);
  opacity: 0.2;
  top: -100px; left: -100px;
  z-index: 1;
}

.login-box {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 4rem 3.5rem;
  border-radius: 32px;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.6);
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.4);
}

.login-box {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 4rem 3.5rem;
  border-radius: 32px;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.6);
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.4);
}

.login-logo {
  margin-bottom: 2.5rem;
  text-align: center;
  transform: scale(1.2);
}

.login-box h1 {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--tm-primary);
  margin-bottom: 0.75rem;
  text-align: center;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.login-subtitle {
  color: var(--tm-muted);
  text-align: center;
  margin-bottom: 3rem;
  font-size: 1rem;
  opacity: 0.8;
}

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

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tm-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-box .form-control {
  background: #f8fafc;
  border: 2px solid transparent;
  padding: 14px 18px;
  font-size: 1rem;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.login-box .form-control:focus {
  background: white;
  border-color: var(--tm-primary);
  box-shadow: 0 0 0 5px rgba(30, 58, 30, 0.1);
  transform: translateY(-1px);
}

.login-box .btn-primary {
  padding: 16px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 30, 0.4);
  background: linear-gradient(135deg, var(--tm-primary), #2d5a27);
  border: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-box .btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(30, 58, 30, 0.5);
  filter: brightness(1.1);
}

.login-error {
  background: #fff1f2;
  border: 1px solid #ffe4e6;
  color: #e11d48;
  padding: 1.25rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.08);
}

/* 11. NEWS FORM LAYOUT (Two-Column Premium)
   ============================================================ */
.tata-letak-isian {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.isian-utama {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.judul-isian-wrapper {
  background: var(--tm-white);
  padding: 1.5rem;
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--tm-border);
}

.judul-isian-input {
  width: 100%;
  border: none;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--tm-primary);
  font-family: var(--tm-font-head);
  padding: 0.5rem 0;
  background: transparent;
}

.judul-isian-input:focus { outline: none; }
.judul-isian-input::placeholder { color: #cbd5e1; font-weight: 700; }

.editor-container {
  background: var(--tm-white);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--tm-border);
  overflow: hidden;
}

.wp-editor-container { border: none !important; }
.wp-editor-tabs { background: #f8fafc !important; padding: 10px 15px 0 !important; }
.wp-switch-editor { 
  border-radius: 8px 8px 0 0 !important; 
  padding: 6px 12px !important; 
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  color: var(--tm-muted) !important;
  border: 1px solid transparent !important;
}
.wp-switch-editor:hover { background: #fff !important; }
.active .wp-switch-editor { 
  background: #fff !important; 
  border: 1px solid var(--tm-border) !important; 
  border-bottom-color: #fff !important;
  color: var(--tm-primary) !important;
}

.quicktags-toolbar, .mce-toolbar-grp {
  background: #f8fafc !important;
  padding: 10px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.isian-samping {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: calc(var(--tm-header-h) + 2rem);
}

.kotak-data {
  background: var(--tm-white);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--tm-border);
  overflow: hidden;
}

.kotak-data-header {
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--tm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kotak-data-header h3 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tm-primary);
  margin: 0;
}

.kotak-data-inside { padding: 1.5rem; }

.publish-info { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.info-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--tm-muted); }
.info-item i { color: var(--tm-primary); opacity: 0.6; }
.info-item strong { color: var(--tm-text); font-weight: 600; }

.action-publish {
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid var(--tm-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 10. RESPONSIVE (Optimized Premium)
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }
  .desa-sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    box-shadow: 25px 0 50px rgba(0, 0, 0, 0.2);
    height: 100vh;
    transition: var(--tm-transition);
    z-index: 9999;
  }
  .desa-sidebar.active { transform: translateX(0); }
  .desa-content { padding: 1.25rem; }
  .desa-header { padding: 0 1.25rem; gap: 0.5rem; }
  .desa-header h1 { font-size: 1.1rem; }
  .desa-header h1 i { display: none; }
  
  .header-actions { gap: 0.5rem; }
  .header-actions .btn span { display: none; }
  .header-actions .btn { padding: 0.6rem; min-width: 44px; justify-content: center; }
  
  .tata-letak-isian { grid-template-columns: 1fr; }
  .isian-samping { position: static; }
}

@media (max-width: 768px) {
  .desa-content { padding: 1rem; }
  
  .desa-table-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }
  
  .desa-table { display: block; }
  .desa-table thead { display: none; }
  .desa-table tr {
    display: block;
    background: var(--tm-white);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--tm-border);
    position: relative;
  }
  
  .desa-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    text-align: right;
  }
  
  .desa-table td:last-child { border-bottom: none; }
  
  .desa-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--tm-muted);
    text-align: left;
    margin-right: 1rem;
  }

  .stats-grid { grid-template-columns: 1fr; gap: 1rem; }
  
  .filter-bar { 
    flex-direction: column; 
    align-items: stretch; 
    padding: 1.25rem;
    gap: 1rem;
    background: var(--tm-white);
  }
  
  .search-wrapper { width: 100%; }
  
  .filter-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }
  
  .filter-controls select, 
  .filter-controls .btn {
    width: 100%;
    margin: 0 !important;
  }
  
  .admin-grid-layout,
  .tata-letak-isian { 
    grid-template-columns: 1fr !important; 
    gap: 1.5rem; 
  }
}

@media (max-width: 480px) {
  .desa-header h1 { font-size: 1rem; }
  .desa-content h2 { font-size: 1.5rem; }
  .judul-isian-input { font-size: 1.5rem; }
}