/* Apple-inspired Design System */
:root {
  /* Colors */
  --bg-color: #f5f5f7;
  --card-bg: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #bfbfc3;
  
  --accent-color: #0071e3;
  --accent-hover: #0077ed;
  --accent-light: rgba(0, 113, 227, 0.1);
  
  --danger-color: #ff3b30;
  --success-color: #34c759;
  --warning-color: #ffcc00;

  --border-color: #d2d2d7;
  --input-bg: #f2f2f7;
  --divider-color: #e5e5ea;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.12);

  /* Font */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-md: 16px;
  --font-size-lg: 17px;
}

/* Reset & Base */
* { box-sizing: border-box; }
body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--font-size-base);
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
a { color: var(--accent-color); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
a.button { display: inline-block; cursor: pointer; }

/* Utilities - Flex */
.d-flex { display: flex; }
.d-block { display: block; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex-wrap { flex-wrap: wrap; }

/* Utilities - Spacing */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: 0; }
.ml-1 { margin-left: var(--space-xs); }
.ml-2 { margin-left: var(--space-sm); }
.mr-1 { margin-right: var(--space-xs); }
.mr-2 { margin-right: var(--space-sm); }
.mr-3 { margin-right: var(--space-md); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }
.py-3 { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.px-3 { padding-left: var(--space-md); padding-right: var(--space-md); }

/* Utilities - Typography */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); font-size: var(--font-size-sm); }
.text-danger { color: var(--danger-color); }
.font-bold { font-weight: 600; }
.font-sm { font-size: var(--font-size-sm); }
.font-md { font-size: var(--font-size-md); }
.font-lg { font-size: var(--font-size-lg); }
.font-xl { font-size: 20px; font-weight: 600; }
.font-xs { font-size: 11px; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.break-all { word-break: break-all; }
.leading-relaxed { line-height: 1.625; }

/* Utilities - Layout */
.w-100, .w-full { width: 100%; }
.mw-200 { max-width: 200px; }
.max-w-sm { max-width: 400px; }
.min-h-screen { min-height: 100vh; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px));
}
.mobile-container {
  max-width: 600px;
  padding: 16px;
  padding-bottom: 80px;
  margin: 0 auto;
}
.hidden { display: none !important; }

/* Components - Card */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.02);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { margin-bottom: var(--space-md); border-bottom: 1px solid var(--divider-color); padding-bottom: var(--space-sm); }

/* Components - Forms */
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: var(--font-size-sm); color: var(--text-primary); }
label { display: block; margin-bottom: 6px; font-weight: 500; font-size: var(--font-size-sm); color: var(--text-primary); }
input, select, textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: var(--font-size-base);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background-color: var(--input-bg);
  color: var(--text-primary);
  transition: all 0.2s;
}
.form-select {
  display: inline-block;
  width: auto;
  padding: 8px 32px 8px 12px;
  font-family: inherit;
  font-size: var(--font-size-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--input-bg);
  color: var(--text-primary);
  cursor: pointer;
  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='%236e7781' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.form-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.2);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  background-color: #fff;
  box-shadow: 0 0 0 2px var(--accent-color);
}
input[type="checkbox"] { width: auto; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* Components - Buttons */
.btn, button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--accent-color);
  color: white;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover, button:hover, .button:hover { background-color: var(--accent-hover); transform: translateY(-1px); text-decoration: none; color: white; }
.btn:active, button:active, .button:active { transform: translateY(0); opacity: 0.9; }
.btn-primary { background-color: var(--accent-color); color: white; }
.btn.secondary, button.secondary, .button.secondary { background-color: #e5e5ea; color: var(--text-primary); }
.btn.secondary:hover, button.secondary:hover, .button.secondary:hover { background-color: #d1d1d6; }
.btn.danger, button.danger, .button.danger { background-color: var(--danger-color); color: white; }
.btn.danger:hover, button.danger:hover, .button.danger:hover { background-color: #d6332a; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }
.btn-block { width: 100%; }

/* Components - Notice Marquee */
.notice-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}
.notice-icon { color: var(--accent-color); flex: none; }
.notice-scroll { flex: 1; overflow: hidden; white-space: nowrap; }
.notice-text {
  display: inline-block;
  padding-left: 100%;
  font-size: var(--font-size-sm);
  animation: notice-marquee 12s linear infinite;
}
@keyframes notice-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
.article-content img { max-width: 100%; border-radius: var(--radius-sm); }
.article-content p:last-child { margin-bottom: 0; }

/* Components - Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md); }
.grid-1 { display: grid; grid-template-columns: 1fr !important; gap: var(--space-md); }
.grid-1 .ad-card img { aspect-ratio: auto !important; height: auto !important; object-fit: contain !important; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr) !important; gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr) !important; gap: var(--space-sm); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr) !important; gap: var(--space-sm); }
.grid-4 .ad-card { background: transparent; box-shadow: none; }
.grid-4 .ad-card:hover { transform: none; box-shadow: none; }
.grid-4 .ad-card img { aspect-ratio: 1/1 !important; object-fit: cover !important; border-radius: var(--radius-lg); }
.grid-4 .ad-card-content { padding: 6px 0 0; }
.grid-4 .ad-card-title { text-align: center; font-size: var(--font-size-sm); -webkit-line-clamp: 1; margin-bottom: 0; }
.col-span-full { grid-column: 1 / -1; }

/* Components - Badge */
.status-badge { display: inline-flex; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.status-active, .status-approved, .status-published { background-color: #e5f9e7; color: #2da44e; }
.status-inactive, .status-rejected { background-color: #ffebe9; color: #cf222e; }
.status-pending, .status-draft { background-color: #fff8c5; color: #9a6700; }
.status-pinned { background-color: #ddf4ff; color: #0969da; }
.status-paused { background-color: #fff8c5; color: #9a6700; }
.status-archived, .status-expired { background-color: #f0f0f0; color: #6e7781; }

.badge { display: inline-flex; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.badge-primary { background-color: #ddf4ff; color: #0969da; }
.badge-success { background-color: #e5f9e7; color: #2da44e; }
.badge-warning { background-color: #fff8c5; color: #9a6700; }
.badge-danger { background-color: #ffebe9; color: #cf222e; }
.btn-danger { background-color: var(--danger-color) !important; color: white !important; }
.btn-danger:hover { background-color: #d6332a !important; }

.list-item { padding: 12px 0; border-bottom: 1px solid var(--divider-color); }
.list-item:last-child { border-bottom: none; }

/* Components - Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); overflow-y: auto; }
.modal.active { display: block; }
.modal-content {
  background-color: var(--card-bg);
  margin: 40px auto;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
@keyframes modalSlideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close { position: absolute; top: 16px; right: 20px; font-size: 24px; color: var(--text-secondary); cursor: pointer; transition: color 0.2s; line-height: 1; }
.close:hover { color: var(--text-primary); }
.modal-backdrop { position: absolute; inset: 0; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-lg); border-bottom: 1px solid var(--border-color); padding-bottom: var(--space-md); }
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-secondary); padding: 0; line-height: 1; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { margin-bottom: var(--space-lg); }
.modal-footer { display: flex; justify-content: flex-end; gap: var(--space-sm); padding-top: var(--space-md); border-top: 1px solid var(--border-color); }
.detail-row { display: flex; margin-bottom: var(--space-sm); }
.detail-label { min-width: 100px; color: var(--text-secondary); font-size: 14px; }
.detail-value { flex: 1; font-size: 14px; word-break: break-all; }
.detail-value a { color: var(--primary); text-decoration: none; }
.detail-value a:hover { text-decoration: underline; }
.detail-image { margin-top: var(--space-sm); }
.detail-image img { max-width: 100%; max-height: 300px; border-radius: var(--radius-md); cursor: pointer; transition: transform 0.2s; }
.detail-image img:hover { transform: scale(1.02); }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 250px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-right: 1px solid rgba(255,255,255,0.1);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-sidebar h3 {
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.admin-content { flex: 1; padding: 32px; background-color: var(--bg-color); overflow-y: auto; }
.nav-item {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}
.nav-item:hover { 
  background-color: rgba(255,255,255,0.1); 
  color: #f1f5f9; 
}
.nav-item.active { 
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); 
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  margin-top: auto;
}

.user-info {
  background-color: rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.user-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.user-id {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  word-break: break-all;
}

.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  background-color: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background-color: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.logout-btn svg {
  flex-shrink: 0;
}

.view-section { display: none; animation: fadeIn 0.3s ease; }
.view-section.active { display: block; }
.header { margin-bottom: var(--space-lg); }

/* Ad Card */
.ad-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}
.ad-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ad-card img { width: 100%; height: auto; display: block; object-fit: cover; aspect-ratio: 16/9; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.ad-card-no-content img { border-radius: var(--radius-md); }
.ad-card-content { padding: 10px; flex: 1; display: flex; flex-direction: column; }
.ad-card-title { font-weight: 600; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.ad-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--accent-color);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  z-index: 1;
}
.ad-badge-blue { background: var(--accent-color); }
.ad-badge-red { background: #e5484d; }
.ad-badge-orange { background: #f76b15; }
.ad-badge-green { background: #30a46c; }

/* Tab Bar */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 20px));
  z-index: 999;
  box-shadow: 0 -1px 2px rgba(0,0,0,0.02);
}
.tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; padding: 4px 12px; cursor: pointer; transition: color 0.2s; }
.tab-item.active { color: var(--accent-color); }
.tab-item svg { margin-bottom: 4px; }
.tab-item span { font-size: 10px; font-weight: 500; }
.tab-content { display: none; animation: fadeIn 0.2s ease; }
.tab-content.active { display: block; }

/* Category Tabs */
.category-tabs { display: flex; overflow-x: auto; gap: 8px; padding: 4px; -ms-overflow-style: none; scrollbar-width: none; margin-bottom: 8px; }
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 18px; font-size: 13px;
  background-color: rgba(0,0,0,0.05); color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s; font-weight: 500;
  border: 1px solid transparent;
}
.cat-tab.active { background-color: var(--accent-color); color: white; }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 16px; color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--divider-color); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--divider-color); color: var(--text-primary); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Mobile Optimizations */
/* Stats Cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.total { background: linear-gradient(135deg, #e3f2fd, #bbdefb); }
.stat-icon.active { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); }
.stat-icon.warning { background: linear-gradient(135deg, #fff3e0, #ffe0b2); }
.stat-icon.impressions { background: linear-gradient(135deg, #f3e5f5, #e1bee7); }

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Time Filter Buttons */
.time-filter {
  display: flex;
  gap: var(--space-xs);
  background: var(--input-bg);
  padding: 4px;
  border-radius: var(--radius-md);
}

.time-filter-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.time-filter-btn:hover {
  color: var(--text-primary);
}

.time-filter-btn.active {
  background: var(--card-bg);
  color: var(--accent-color);
  box-shadow: var(--shadow-sm);
}

/* Bottom Sheet */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

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

.bottom-sheet {
  background-color: var(--card-bg);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 20px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.bottom-sheet-overlay.active .bottom-sheet {
  transform: translateY(0);
}

.bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider-color);
}

.bottom-sheet-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-sheet {
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.bottom-sheet-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet-item {
  padding: 16px;
  border-bottom: 1px solid var(--divider-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  transition: background-color 0.2s;
  border-radius: 8px;
}

.sheet-item:last-child {
  border-bottom: none;
}

.sheet-item:hover, .sheet-item:active {
  background-color: var(--bg-color);
}

.sheet-item.selected {
  color: var(--accent-color);
  font-weight: 500;
}

.sheet-item.selected::after {
  content: "✓";
  font-weight: bold;
}

/* Form Select Trigger - matches input style */
.form-select-trigger {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: var(--font-size-base);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background-color: var(--input-bg);
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
}

.form-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  pointer-events: none;
}

.form-select-trigger:active {
  background-color: #e5e5ea;
}

/* Trend Summary */
.trend-summary {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-md);
  background: var(--input-bg);
  border-radius: var(--radius-md);
}

.trend-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trend-summary-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.trend-summary-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Grid Layout */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

/* Top Ads List */
.top-ads-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.top-ad-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.top-ad-item:hover {
  background: var(--accent-light);
}

.top-ad-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card-bg);
  border-radius: var(--radius-full);
}

.top-ad-rank.top-3 {
  color: var(--accent-color);
  background: var(--accent-light);
}

.top-ad-info {
  flex: 1;
  min-width: 0;
}

.top-ad-title {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-ad-stats {
  font-size: 12px;
  color: var(--text-secondary);
}

.top-ad-value {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--accent-color);
}

/* Placement Stats */
.placement-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.placement-stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--input-bg);
  border-radius: var(--radius-md);
}

.placement-stat-info {
  flex: 1;
}

.placement-stat-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.placement-stat-key {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.placement-stat-metrics {
  display: flex;
  gap: var(--space-lg);
}

.placement-stat-metric {
  text-align: center;
}

.placement-stat-metric-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.placement-stat-metric-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--divider-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-sm);
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--divider-color); padding: 12px; }
  .admin-content { padding: 16px; }
  /* Mobile table styling */
  td, th { padding: 10px 8px; }

  .modal-content {
    width: 95%;
    margin: 20px auto;
    padding: var(--space-md);
  }

  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .stat-value {
    font-size: 22px;
  }

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

  .trend-summary {
    gap: var(--space-md);
  }

  .trend-summary-value {
    font-size: 20px;
  }

  .placement-stat-metrics {
    gap: var(--space-sm);
  }
}

/* Slide Panel */
.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  pointer-events: none;
  visibility: hidden;
}

.slide-panel.active {
  pointer-events: auto;
  visibility: visible;
}

.slide-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
}

.slide-panel.active .slide-panel-overlay {
  background-color: rgba(0, 0, 0, 0.5);
}

.slide-panel-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 560px;
  max-width: 100%;
  height: 100%;
  background-color: var(--card-bg);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.slide-panel.active .slide-panel-content {
  transform: translateX(0);
}

.slide-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--divider-color);
  flex-shrink: 0;
}

.slide-panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.slide-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.slide-panel-close:hover {
  background: var(--bg-color);
  color: var(--text-primary);
}

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

/* Create Ad Form in Panel */
.create-ad-form .form-row {
  margin-bottom: var(--space-md);
}

.create-ad-form .form-row:last-of-type {
  margin-bottom: var(--space-lg);
}

.create-ad-form .form-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  padding-top: var(--space-md);
  border-top: 1px solid var(--divider-color);
  margin-top: var(--space-md);
}

.create-ad-form .image-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--input-bg);
}

.create-ad-form .image-upload-area:hover {
  border-color: var(--accent-color);
  background: var(--accent-light);
}

.create-ad-form .image-upload-area.has-image {
  padding: var(--space-sm);
  border-style: solid;
}

.create-ad-form .image-upload-area img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
}

.create-ad-form .upload-placeholder {
  color: var(--text-secondary);
}

.create-ad-form .upload-placeholder svg {
  margin-bottom: var(--space-sm);
}

/* Primary Button Style */
.btn-primary {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #0071e3 0%, #0077ed 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

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

/* Request Card */
.request-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.request-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.request-card:active {
  transform: translateY(0);
}

/* Request Detail */
.request-detail {
  padding-bottom: var(--space-md);
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider-color);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-value {
  font-size: 15px;
  color: var(--text-primary);
  word-break: break-all;
}

.detail-link {
  font-size: 14px;
  color: var(--accent-color);
  word-break: break-all;
}

.detail-image {
  max-width: 120px;
  max-height: 80px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 8px;
  object-fit: cover;
}

.text-danger {
  color: var(--danger-color);
}

/* Mobile Responsive for Slide Panel */
@media (max-width: 768px) {
  .slide-panel-content {
    width: 100%;
  }
  
  .header {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
  
  .header h2 {
    font-size: 20px;
  }
  
  .btn-primary {
    padding: 8px 16px;
    font-size: 14px;
  }
}
