/* Root Variables */
:root {
  --bg: #fff;
  --paper: #f7f9fb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #16a34a;
  --brand: #0ea5e9;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
  --gradient: linear-gradient(135deg, #3b82f6, #a855f7);
}

/* Reset */
* {
  box-sizing: border-box;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.right-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.55 Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial;
}

a {
  color: inherit;
  text-decoration: none;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.brand {
  font-size: 18px;
  font-weight: bold;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: center;
  flex-grow: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info {
  font-size: 15px;
  color: #374151;
}

.credit-display {
  padding: 6px 12px;
  border-radius: 8px;
  background: #f0fdf4;
  color: #16a34a;
  font-weight: 600;
}

.credit-display.credit-empty {
  background: #fee2e2;
  color: #dc2626;
}

.credit-warning {
  font-size: 14px;
  color: #dc2626;
  font-weight: 600;
}

.credit-error {
  color: red;
  font-size: 14px;
}

.logout-btn {
  padding: 6px 12px;
  border-radius: 8px;
  background: #ef4444;
  color: white;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.logout-btn:hover {
  background: #dc2626;
}

/* Mobile menu */
.header-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.header-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 60;
  min-width: 160px;
  padding: 4px 0;
}

.header-menu.show {
  display: block;
}

.header-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-menu li {
  padding: 8px 16px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.header-menu li:hover {
  background: #e7f3ff;
  color: #0b66c3;
}

/* Not logged */
.not-logged {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 20px;
}

.not-logged-box {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  max-width: 450px;
  width: 100%;
}

.not-logged-text {
  font-size: 1.2rem;
  color: #495057;
  margin-bottom: 30px;
}

.login-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
}

.login-btn:hover {
  transform: translateY(-2px);
}