:root {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --text: #1f1c17;
  --muted: #7d7468;
  --accent: #c96b2c;
  --accent-2: #3a5a40;
  --border: #e3d9cc;
  --danger: #b13d2b;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --sidebar: #1f1c17;
  --sidebar-text: #efe7dc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #fef7ec, #efe4d6 55%, #e6d7c5);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
  padding: 40px 20px;
}

.auth-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--accent), #e7a15c);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.brand-mark.lg {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form {
  display: grid;
  gap: 14px;
}

.form.horizontal {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
}

input:focus {
  outline: 2px solid rgba(201, 107, 44, 0.3);
  border-color: var(--accent);
}

.primary-btn,
.ghost-btn {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.ghost-btn.danger {
  border-color: rgba(177, 61, 43, 0.4);
  color: var(--danger);
}

.alert {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
}

.alert.error {
  background: rgba(177, 61, 43, 0.1);
  color: var(--danger);
}

.alert.success {
  background: rgba(58, 90, 64, 0.1);
  color: var(--accent-2);
}

.auth-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  transition: transform 0.3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu {
  display: grid;
  gap: 10px;
}

.menu-link {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
  transition: 0.2s ease;
}

.menu-link.active,
.menu-link:hover {
  background: rgba(255, 255, 255, 0.18);
}

.sidebar-foot {
  margin-top: auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 14px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(140deg, #f0a86a, #c96b2c);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
}

.user-role {
  font-size: 12px;
  color: rgba(239, 231, 220, 0.7);
}

.content {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.topbar-title {
  font-weight: 700;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.icon-btn span {
  height: 2px;
  background: var(--text);
  width: 18px;
  display: block;
}

.grid {
  display: grid;
  gap: 20px;
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card.big {
  max-width: 320px;
}

.card-title {
  font-size: 14px;
  color: var(--muted);
}

.card-value {
  font-size: 44px;
  font-weight: 700;
  margin: 8px 0;
}

.card-sub {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.panel h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
}

.table {
  display: grid;
  gap: 10px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 1fr 0.7fr;
  gap: 10px;
  align-items: center;
}

.table-head {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.table-empty {
  padding: 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    transform: translateX(-100%);
    z-index: 20;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .icon-btn {
    display: flex;
  }

  .content {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .form.horizontal {
    grid-template-columns: 1fr;
  }

  .table-head,
  .table-row {
    grid-template-columns: 1fr;
  }

  .table-row {
    gap: 6px;
  }
}