/* === Основной Layout === */
.app {
  display: flex;
  min-height: 100vh;
}

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

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.sidebar-logo-text {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.sidebar-logo-sub {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.5);
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: 0.5rem 1.5rem 0.25rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.35);
  margin-top: 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.sidebar-link:hover {
  color: var(--text-white);
  background: rgba(255,255,255,0.06);
}

.sidebar-link.active {
  color: var(--text-white);
  background: rgba(255,255,255,0.1);
  border-right: 3px solid var(--primary);
}

.sidebar-link-icon { font-size: 1.125rem; width: 20px; text-align: center; }

.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.sidebar-user-name { font-size: 0.875rem; font-weight: 500; }
.sidebar-user-role { font-size: 0.75rem; color: rgba(255,255,255,0.45); }

/* === Main Content === */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title { font-size: 1.125rem; font-weight: 600; }
.header-breadcrumb { font-size: 0.8125rem; color: var(--text-light); }
.header-breadcrumb a { color: var(--text-light); }
.header-breadcrumb a:hover { color: var(--primary); }
.header-breadcrumb span { margin: 0 0.375rem; }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.content {
  padding: 2rem;
  max-width: 1200px;
}

.content-wide {
  padding: 2rem;
}

/* === Page Header === */
.page-header {
  margin-bottom: 2rem;
}

.page-header-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.page-header-desc {
  color: var(--text-light);
  font-size: 0.9375rem;
}

/* === Login === */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--secondary) 0%, #2D2D44 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 0.75rem;
}

.login-logo h2 {
  font-size: 1.25rem;
  color: var(--secondary);
}

.login-logo p {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.login-error {
  background: var(--error-light);
  color: #991B1B;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.login-error.visible { display: block; }

/* === Tables === */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  border-bottom: 2px solid var(--border-light);
}

.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}

.table tr:hover td { background: var(--bg); }

/* === Search === */
.search-bar {
  position: relative;
  max-width: 400px;
}

.search-bar input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  background: var(--bg-white);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

.search-bar-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
