:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --anthracite: #1e293b;
  --anthracite-light: #334155;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  margin: 0;
  line-height: 1.5;
}

header {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-blocks {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-block {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-nav a {
  text-decoration: none;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.brand-nav a:hover {
  color: var(--primary);
}

.brand-nav .brand img {
  height: 40px;
  object-fit: contain;
}

.search-form {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 4px;
  width: 320px;
  border: 1px solid var(--gray-200);
}

.search-form input {
  border: none;
  background: transparent;
  padding: 8px 12px;
  flex: 1;
  outline: none;
  font-size: 0.9rem;
  color: var(--anthracite);
}

.search-form button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.search-form button:hover {
  background: var(--primary-dark);
}

.rate {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--anthracite);
  background: #fff7ed;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #ffedd5;
  white-space: nowrap;
}

.user-cart a {
  text-decoration: none;
  background: var(--anthracite);
  color: white;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.user-cart a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  background: var(--anthracite-light);
}

main {
  min-height: calc(100vh - 200px);
}

/* Sidebar Dropdown/Tree fallback styles if needed */
.tree-item { margin-bottom: 4px; }
.tree-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}
.tree-header:hover { background: var(--gray-100); }
.tree-header.active { background: var(--gray-100); color: var(--primary); font-weight: 700; }

.sidebar-link {
  flex: 1;
  text-decoration: none;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 500;
}

.tree-toggle {
  padding: 4px;
  display: flex;
  align-items: center;
  transition: transform 0.2s;
  color: var(--gray-400);
}
.tree-toggle.expanded { transform: rotate(90deg); color: var(--primary); }
.tree-toggle svg { width: 14px; height: 14px; }

.tree-children {
  margin-left: 18px;
  display: none;
  border-left: 1px solid var(--gray-200);
  padding-left: 8px;
}
.tree-children.show { display: block; }

/* ========================================
   ADMIN PANEL LAYOUT
   ======================================== */

.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}

.admin-content {
  flex: 1;
  min-width: 0;
  padding: 28px;
  background: #f1f5f9;
  overflow-x: auto;
}

.admin-content .panel {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-content .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-content .panel-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--anthracite);
}

.admin-content .action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-content .action:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  color: white;
}

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

.admin-content table th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.admin-content table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--anthracite);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-content table tr:hover td {
  background: #fafbfc;
}

.admin-content table a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.admin-content table a:hover {
  text-decoration: underline;
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-top: 3px solid var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Admin forms & filters */
.admin-content input[type="text"],
.admin-content input[type="number"],
.admin-content input[type="email"],
.admin-content input[type="password"],
.admin-content input[type="date"],
.admin-content select,
.admin-content textarea {
  padding: 9px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--anthracite);
  background: white;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-content input:focus,
.admin-content select:focus,
.admin-content textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

* {
  box-sizing: border-box;
}
