/* BUHODEX Base Styles
   Depends on: tokens.css
   ------------------------------------------------ */

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--page-bg);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

a {
  color: var(--steel-blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code, pre, .mono {
  font-family: var(--font-mono);
}

/* --- Page shell layout --- */
.shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width var(--transition-base);
  overflow-x: hidden;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.sidebar__logo svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar__logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--white);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.sidebar__nav {
  flex: 1;
  padding: 0 8px;
  overflow-y: auto;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-decoration: none;
}

.sidebar__link--active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
}

.sidebar__link-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar__link--active .sidebar__link-icon {
  opacity: 1;
}

/* --- Main content area --- */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-base);
}

/* --- Top bar --- */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar__breadcrumb,
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.topbar__breadcrumb a,
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.topbar__breadcrumb a:hover,
.breadcrumb a:hover {
  color: var(--steel-blue);
  text-decoration: none;
}

.topbar__breadcrumb-sep::after,
.breadcrumb__sep::after {
  content: "/";
  margin: 0 2px;
  color: var(--input-border);
}

.breadcrumb__current {
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Page content --- */
.content {
  flex: 1;
  padding: 24px;
}

/* --- Responsive sidebar collapse at 1024px --- */
@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  .sidebar__logo-text,
  .sidebar__link span {
    display: none;
  }
  .sidebar__logo {
    justify-content: center;
    padding: 16px 8px 24px;
  }
  .sidebar__link {
    justify-content: center;
    padding: 10px;
  }
  .main {
    margin-left: var(--sidebar-collapsed);
  }
}
