/* ============================================================
   LAYOUT - App shell, sidebar, topbar
   ============================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--brand-black);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo-mark {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sidebar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-logo-name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  color: white;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.sidebar-logo-subtitle {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.sidebar-nav {
  padding: var(--space-3);
  flex: 1;
}

.nav-section {
  margin-bottom: var(--space-5);
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 var(--space-3) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1px;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.nav-item.active {
  background: var(--brand-burgundy);
  color: white;
}

.nav-item.active:hover {
  background: var(--brand-burgundy-light);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  min-width: 0;
}

.nav-badge {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: rgba(0, 0, 0, 0.25);
}

/* User block στο κάτω μέρος sidebar */
.sidebar-user {
  padding: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-block {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  width: 100%;
}

.user-block:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--brand-burgundy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: white;
  line-height: 1.2;
}

.user-username {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
}

/* === MAIN CONTENT === */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.content {
  flex: 1;
  padding: var(--space-6) var(--space-8);
  overflow-x: hidden;
}

.page-header {
  margin-bottom: var(--space-6);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.page-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* === LOGIN SCREEN === */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Decorative background pattern */
.login-screen::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  opacity: 0.6;
  pointer-events: none;
}

.login-screen::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--surface-2) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.login-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  text-align: center;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--muted);
}

/* === DROPDOWN === */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  overflow: hidden;
  animation: slideDown 150ms ease;
}

.dropdown-menu.left { right: auto; left: 0; }
.dropdown-menu.up { top: auto; bottom: calc(100% + 4px); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 12px;
  font-size: var(--text-sm);
  color: var(--ink);
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: transparent;
}

.dropdown-item:hover {
  background: var(--surface-2);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: var(--danger-soft);
}

.dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === BOTTOM NAVIGATION (mobile) === */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.bottom-tab.active { color: var(--primary); }

.bottom-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}

.bottom-tab-label { line-height: 1; }

/* === MORE SHEET === */
.more-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 200ms ease;
}

.more-sheet-backdrop.show { opacity: 1; }

.more-sheet {
  width: 100%;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 250ms ease;
  max-height: 85vh;
  overflow-y: auto;
}

.more-sheet-backdrop.show .more-sheet { transform: translateY(0); }

.more-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--line-2);
  border-radius: var(--radius-full);
  margin: 0 auto 14px;
}

.more-sheet-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  padding: 0 4px;
}

.more-sheet-section { margin-bottom: 14px; }

.more-sheet-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  padding: 0 4px;
}

.more-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: var(--text-base);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.more-sheet-item:active { background: var(--surface-2); }

.more-sheet-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.more-sheet-item-icon { color: var(--muted); display: flex; }
.more-sheet-item.active .more-sheet-item-icon { color: var(--primary); }

.more-sheet-item-danger { color: var(--danger); }
.more-sheet-item-danger .more-sheet-item-icon { color: var(--danger); }
.more-sheet-item-danger:active { background: var(--danger-soft); }

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .topbar { padding: 0 var(--space-4); }
  .content {
    padding: var(--space-4);
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

