/* === Design Tokens === */
:root {
  --bg:        #f5f5f5;
  --surface:   #ffffff;
  --sidebar-bg:#eaeaea;
  --text:      #1a1a1a;
  --text-dim:  #666666;
  --accent:    #0077cc;
  --danger:    #d32f2f;
  --success:   #2e7d32;
  --warning:   #f9a825;
  --border:    rgba(0, 0, 0, 0.1);
  --radius:    10px;
  --sidebar-w: 220px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav li {
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
  font-size: 0.95em;
}

.sidebar-nav li:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sidebar-nav li.active {
  background: rgba(76, 201, 240, 0.1);
  color: var(--accent);
  border-right: 3px solid var(--accent);
}

.sidebar-nav li .nav-icon {
  font-size: 1.15em;
  width: 24px;
  text-align: center;
}

/* === App Header (mobile top bar) === */
.app-header {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  transition: transform 0.25s ease;
}

.app-header.header-hidden {
  transform: translateY(-100%);
}

.app-title {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--accent);
}

.hamburger {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5em;
  padding: 4px 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* === Overlay (mobile sidebar backdrop) === */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 250;
}
.overlay.visible { display: block; }

/* === Main Content === */
.main {
  margin-left: var(--sidebar-w);
  padding: 24px;
  min-height: 100vh;
}

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

/* === Card === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-title {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* === Status Badge === */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}
.status-badge.success { background: var(--success); color: #000; }
.status-badge.danger  { background: var(--danger);  color: #000; }
.status-badge.warning { background: var(--warning); color: #000; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  color: #000;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-success { background: var(--success); }
.btn-danger  { background: var(--danger);  }
.btn-warning { background: var(--warning); }
.btn-accent  { background: var(--accent);  }

.btn-lg {
  padding: 16px 32px;
  font-size: 1.2em;
  min-width: 140px;
}

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

.img-thumb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.img-thumb:hover { border-color: var(--accent); }
.img-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

/* === View Header === */
.view-header {
  margin-bottom: 20px;
}

.view-header h1 {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

/* === Utility === */
.mb { margin-bottom: 16px; }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }

/* === Responsive === */
@media (max-width: 768px) {
  .app-header { display: flex; }
  .sidebar-header { display: none; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.1s ease;
  }
  .sidebar.open { transform: translateX(0); z-index: 300; }

  .main {
    margin-left: 0;
    padding: 60px 12px 12px;
  }

  .grid { grid-template-columns: 1fr; }
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .btn-lg {
    width: 100%;
    padding: 18px;
    font-size: 1.3em;
  }
}
