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

:root {
  --brand: #ff6a00;
  --brand-dark: #e05e00;
  --dark: #1e1e23;
  --dark-lighter: #2a2a32;
  --bg: #f6f6f7;
  --white: #ffffff;
  --text: #333340;
  --text-light: #6b6b80;
  --border: #e0e0e5;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --sidebar-width: 250px;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

/* ============================
   LOGIN PAGE — SPLIT LAYOUT
   ============================ */
.login-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--dark);
}

.login-split {
  display: flex;
  min-height: 100vh;
}

/* ---- LEFT: BRAND PANEL ---- */
.login-brand {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
}

.login-brand-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e1e23 0%, #2a2a32 40%, #1e1e23 100%);
}

/* Glowing orbs */
.login-brand-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: glowFloat 8s ease-in-out infinite;
}

.login-brand-glow--1 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(255,106,0,0.45) 0%, transparent 70%);
  top: -60px;
  left: -60px;
  animation-delay: 0s;
}

.login-brand-glow--2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,140,0,0.3) 0%, transparent 70%);
  bottom: -40px;
  right: -40px;
  animation-delay: -4s;
}

@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(20px, -20px) scale(1.1); opacity: 0.7; }
}

/* Subtle grid pattern */
.login-brand-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Brand content */
.login-brand-content {
  position: relative;
  z-index: 2;
  padding: 60px 50px;
  max-width: 480px;
}

.login-brand-logo {
  max-width: 220px;
  margin-bottom: 32px;
  filter: brightness(0) invert(1);
}

.login-brand-content h2 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
  line-height: 1.2;
}

.login-brand-content > p {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  margin-bottom: 40px;
}

/* Feature pills */
.login-brand-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-brand-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
}

.login-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,106,0,0.15);
  border: 1px solid rgba(255,106,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-brand-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--brand);
}

/* ---- RIGHT: FORM PANEL ---- */
.login-form-side {
  width: 480px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  padding: 40px;
}

.login-box {
  width: 100%;
  max-width: 380px;
}

.login-box-header {
  margin-bottom: 32px;
}

.login-box-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}

.login-box-header p {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 400;
}

.login-box .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-box label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Input with icon */
.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: var(--text-light);
  pointer-events: none;
  transition: stroke 0.2s;
}

.login-input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg);
}

.login-input-wrap input::placeholder {
  color: #b0b0c0;
}

.login-input-wrap input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(255,106,0,0.1);
}

.login-input-wrap input:focus + svg,
.login-input-wrap:focus-within svg {
  stroke: var(--brand);
}

/* Login button */
.login-box .btn-login {
  width: 100%;
  padding: 14px 20px;
  background: var(--brand);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-box .btn-login:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,106,0,0.35);
}

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

.login-box .btn-login svg {
  transition: transform 0.2s;
}

.login-box .btn-login:hover svg {
  transform: translateX(3px);
}

/* Error */
.login-error {
  background: #fce4e4;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  font-weight: 600;
  border: 1px solid #f5c6cb;
}

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.login-footer span {
  font-size: 0.78rem;
  color: var(--text-light);
  display: block;
}

.login-footer .login-dev {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #b0b0c0;
  letter-spacing: 0.3px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .login-split {
    flex-direction: column;
  }

  .login-brand {
    min-height: 280px;
    flex: none;
  }

  .login-brand-content {
    padding: 40px 30px;
    text-align: center;
    max-width: 100%;
  }

  .login-brand-logo {
    max-width: 160px;
    margin: 0 auto 20px;
    display: block;
  }

  .login-brand-content h2 {
    font-size: 1.5rem;
  }

  .login-brand-content > p {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }

  .login-brand-features {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .login-brand-feature {
    font-size: 0.8rem;
    gap: 8px;
  }

  .login-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .login-brand-icon svg {
    width: 16px;
    height: 16px;
  }

  .login-form-side {
    width: 100%;
    padding: 30px 24px;
  }
}

@media (max-width: 480px) {
  .login-brand {
    min-height: 220px;
  }

  .login-brand-content {
    padding: 30px 20px;
  }

  .login-brand-content h2 {
    font-size: 1.3rem;
  }

  .login-brand-content > p {
    display: none;
  }

  .login-form-side {
    padding: 24px 20px;
  }

  .login-box-header h1 {
    font-size: 1.3rem;
  }
}

/* ============================
   SIDEBAR
   ============================ */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--dark);
  color: var(--white);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--dark-lighter);
  text-align: center;
}

.sidebar-header a {
  display: inline-block;
  background: var(--white);
  border-radius: 50%;
  width: 70px;
  height: 70px;
  padding: 0;
  overflow: hidden;
}

.sidebar-header img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  display: block;
  margin: 10% auto;
}

.sidebar-header span {
  display: block;
  font-size: 0.65rem;
  color: var(--text-light);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 6px 0;
  overflow-y: auto;
}

.nav-section-label {
  padding: 14px 24px 4px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #666680;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px;
  color: #b0b0c0;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--white);
  background: var(--dark-lighter);
}

.sidebar-nav a.active {
  color: var(--brand);
  border-left-color: var(--brand);
  background: rgba(255,106,0,0.08);
}

.sidebar-nav a svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--dark-lighter);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b0b0c0;
  font-size: 0.78rem;
  font-weight: 500;
  transition: color 0.2s;
}

.sidebar-footer a:hover {
  color: var(--danger);
}

/* ============================
   MAIN CONTENT
   ============================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 30px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
}

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-secondary {
  background: var(--dark);
  color: var(--white);
}
.btn-secondary:hover { background: var(--dark-lighter); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { background: #c82333; }

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover { background: #218838; }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ============================
   CARDS & TABLE
   ============================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 24px;
}

.table-responsive {
  overflow-x: auto;
}

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

table th {
  text-align: left;
  padding: 14px 16px;
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

table tr:hover td {
  background: rgba(255,106,0,0.03);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: #e6f4ea;
  color: var(--success);
}

.status-inactive {
  background: #fce4e4;
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 6px;
}

/* ============================
   POST CARDS GRID
   ============================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.post-card-admin {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.post-card-admin:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.post-card-admin .card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--bg);
}

.post-card-admin .card-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-lighter) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.85rem;
}

.post-card-admin .card-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-admin .card-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
  margin-bottom: 6px;
}

.post-card-admin .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-admin .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  margin-top: auto;
}

.post-card-admin .card-date {
  font-size: 0.78rem;
  color: var(--text-light);
}

.post-card-admin .card-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}

.post-card-admin .card-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.posts-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}

.posts-empty p {
  font-size: 1rem;
  margin-bottom: 16px;
}

/* ============================
   UPLOAD AREA
   ============================ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: var(--bg);
}

.upload-area:hover {
  border-color: var(--brand);
  background: rgba(255,106,0,0.03);
}

.upload-area.has-file {
  border-color: var(--success);
  background: #f0faf0;
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-area .upload-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--text-light);
}

.upload-area .upload-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-area .upload-hint {
  font-size: 0.78rem;
  color: var(--text-light);
}

.upload-preview {
  margin-top: 12px;
  position: relative;
  display: inline-block;
}

.upload-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
}

.upload-preview .remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================
   RICH TEXT EDITOR
   ============================ */
.editor-wrapper {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: border-color 0.2s;
}

.editor-wrapper:focus-within {
  border-color: var(--brand);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.editor-toolbar button {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.editor-toolbar button:hover {
  background: var(--white);
  border-color: var(--border);
}

.editor-toolbar button:active {
  background: var(--brand-light);
}

.editor-toolbar select {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  cursor: pointer;
  height: 30px;
}

.editor-toolbar select:focus {
  outline: none;
  border-color: var(--brand);
}

.toolbar-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.editor-content {
  min-height: 120px;
  padding: 12px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  overflow-y: auto;
}

.editor-content.editor-lg {
  min-height: 350px;
}

.editor-sm .editor-content {
  min-height: 80px;
}

.editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-light);
  pointer-events: none;
}

.editor-content h2, .editor-content h3, .editor-content h4 {
  margin: 0.8em 0 0.4em;
}

.editor-content p {
  margin: 0.4em 0;
}

.editor-content blockquote {
  border-left: 3px solid var(--brand);
  margin: 0.8em 0;
  padding: 8px 16px;
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.editor-content ul, .editor-content ol {
  margin: 0.4em 0;
  padding-left: 24px;
}

.editor-content a {
  color: var(--brand);
}

.editor-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 8px 0;
}

.editor-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 16px 0;
}

.editor-code {
  width: 100%;
  min-height: 350px;
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  border: none;
  border-top: 1px solid var(--border);
  background: #1e1e23;
  color: #e0e0e0;
  resize: vertical;
  outline: none;
}

/* ============================
   FORMS
   ============================ */
.form-group {
  margin-bottom: 20px;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  background: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand);
}

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

textarea.form-control-lg {
  min-height: 300px;
}

select.form-control {
  cursor: pointer;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
}

.image-preview {
  max-width: 300px;
  max-height: 200px;
  border-radius: var(--radius);
  margin-top: 10px;
  border: 2px solid var(--border);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

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

/* ============================
   TOGGLE SWITCH
   ============================ */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--success);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ============================
   SECURITY INFO
   ============================ */
.info-box {
  background: #e8f4fd;
  border: 1px solid #b3d9f2;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: #1a5276;
  margin-bottom: 20px;
  line-height: 1.5;
}

.info-box strong {
  display: block;
  margin-bottom: 4px;
}

/* ============================
   ALERTS
   ============================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.alert-success {
  background: #e6f4ea;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #fce4e4;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ============================
   MOBILE TOGGLE
   ============================ */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--brand);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 1.2rem;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
    padding-top: 70px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    flex-direction: column;
  }

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

  .actions {
    flex-direction: column;
  }

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

  table th, table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .login-box {
    margin: 20px;
    padding: 28px 24px;
  }

  .card-body {
    padding: 16px;
  }

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

/* ============================
   USER CARDS
   ============================ */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.user-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-align: center;
  transition: box-shadow 0.2s;
}

.user-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.user-card .user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  display: block;
  border: 3px solid var(--border);
}

.user-card .user-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.8rem;
  font-weight: 700;
}

.user-card .user-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.user-card .user-login {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.user-card .user-status {
  margin-bottom: 16px;
}

.user-card .user-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.user-card .user-actions .btn {
  font-size: 0.75rem;
  padding: 6px 10px;
}

/* ============================
   USER MODAL - BUSINESS CARD
   ============================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  margin: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

.modal-card-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-lighter) 100%);
  padding: 30px 20px 50px;
  text-align: center;
  position: relative;
}

.modal-card-header h2 {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-top: -40px;
  margin-bottom: 16px;
  cursor: pointer;
}

.modal-avatar-wrapper .avatar-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--white);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: block;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.modal-avatar-wrapper .avatar-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid var(--white);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 2rem;
  font-weight: 700;
}

.modal-avatar-wrapper .avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  border: 4px solid transparent;
}

.modal-avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.modal-avatar-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border-radius: 50%;
}

.modal-card-body {
  padding: 0 28px 28px;
  text-align: center;
}

.modal-card-body .form-group {
  text-align: left;
}

.modal-card-body .form-control {
  border-radius: 20px;
}

.modal-card-body .form-control:focus {
  border-radius: 20px;
}

.modal-card-body select.form-control {
  border-radius: 20px;
}

.modal-card-body .form-actions {
  justify-content: center;
}

.modal-card-body .btn {
  border-radius: 20px;
}

/* ============================
   MULTI-UPLOAD AREA
   ============================ */
.upload-counter {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-left: 8px;
}

.multi-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.upload-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.upload-preview-item {
  position: relative;
  width: 140px;
  aspect-ratio: 16/10;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--white);
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-preview-item .remove-image-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.upload-preview-item:hover .remove-image-btn {
  opacity: 1;
}

.cover-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: var(--brand);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.upload-add-btn {
  width: 140px;
  aspect-ratio: 16/10;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-light);
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
}

.upload-add-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(255,106,0,0.03);
}

.upload-add-btn svg {
  opacity: 0.6;
}

.upload-add-btn:hover svg {
  opacity: 1;
}

/* ============================
   CARD CAROUSEL (Admin)
   ============================ */
.card-carousel {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--bg);
}

.card-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

.card-carousel-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.card-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.card-carousel:hover .card-carousel-arrow {
  opacity: 1;
}

.card-carousel-arrow:hover {
  background: rgba(0,0,0,0.7);
}

.card-carousel-arrow.prev {
  left: 6px;
}

.card-carousel-arrow.next {
  right: 6px;
}

.card-carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
}

.card-carousel-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.card-carousel-dots .dot.active {
  background: var(--white);
}
