/* layout.css — Header, Sidebar, Main layout */

/* App container */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Main wrapper */
.main-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  flex-shrink: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Menu toggle (mobile) */
.header-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.header-menu-toggle:hover {
  background: var(--bg-secondary);
}

.header-menu-toggle svg {
  width: 22px;
  height: 22px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: var(--font-size-lg);
}

.header-logo svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.header-logo span {
  white-space: nowrap;
}

/* Header links */
.header-link {
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.header-link:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

/* Header buttons */
.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.header-btn svg {
  width: 20px;
  height: 20px;
}

/* Phone button */
.header-phone {
  color: var(--accent);
}

.header-phone:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* Theme toggle icons */
.theme-icon-dark {
  display: none;
}

html.dark .theme-icon-light {
  display: none;
}

html.dark .theme-icon-dark {
  display: block;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: transform var(--transition-normal);
}

/* Sidebar sections */
.sidebar-section {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-section:last-child {
  border-bottom: none;
  margin-top: auto;
}

.sidebar-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-text-muted);
  margin-bottom: var(--spacing-sm);
}

/* Sidebar items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: var(--font-size-sm);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-xs);
}

.sidebar-item:hover {
  background: var(--sidebar-hover);
}

.sidebar-item.active {
  background: rgba(14, 165, 233, 0.2);
  color: var(--accent);
}

.sidebar-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Sidebar badge */
.sidebar-badge {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--accent);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
}

/* Quick buttons */
.sidebar-quick {
  display: block;
  width: 100%;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: none;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text-muted);
  font-size: var(--font-size-xs);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-xs);
}

.sidebar-quick:hover {
  border-color: var(--accent);
  color: var(--sidebar-text);
}

.sidebar-quick:last-child {
  margin-bottom: 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding-top: var(--spacing-sm);
}

.sidebar-contact {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
}

.sidebar-contact a {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--sidebar-text-muted);
  text-decoration: none;
  font-size: var(--font-size-xs);
  transition: color var(--transition-fast);
}

.sidebar-contact a:hover {
  color: var(--sidebar-text);
}

.sidebar-contact svg {
  width: 14px;
  height: 14px;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

.sidebar-overlay.show {
  display: block;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ============================================
   DRAWER
   ============================================ */
.calc-drawer {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--drawer-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calc-drawer.open {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   BOTTOM TABS (mobile)
   ============================================ */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.bottom-tab:hover,
.bottom-tab.active {
  color: var(--accent);
}

.bottom-tab svg {
  width: 22px;
  height: 22px;
}
