/* MAIN */
@font-face {
    font-family: 'Raleway';
    src: url('../fonts/Raleway-Regular.woff2') format('woff2'),
         url('../fonts/Raleway-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Raleway';
    src: url('../fonts/Raleway-Light.woff2') format('woff2'),
         url('../fonts/Raleway-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Raleway';
    src: url('../fonts/Raleway-Bold.woff2') format('woff2'),
         url('../fonts/Raleway-Bold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-border: #e1e4e8;
  --color-text: #1f2328;
  --color-text-muted: #6a737d;
  --color-primary: #535353;
  --color-primary-dark: #d85701;
  --color-danger: #e74c3c;
  --btn-primary: #FF6600;
  --btn-dark: #f06101;
  --accent: #1F91DC;
  --accent-hover: #00BFFF;
  --border: #1F91DC;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Raleway', Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--btn-primary); text-decoration: none; }

/* ---------- Layout ---------- */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header .brand { font-weight: 700; font-size: 1.5rem; color: var(--accent);}
.brand:hover { color: var(--accent-hover); }
.header nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.header .user-info { color: var(--color-surface); font-size: 0.9rem; background: var(--btn-primary); border-radius: 4px; padding: 6px 12px; }.header .user-info { color: var(--color-surface); font-size: 0.9rem; background: var(--btn-primary); border-radius: 4px; padding: 6px 12px; }

/* ---------- Hamburger (мобильное меню) ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-surface);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 90;
}
.nav-overlay.active { display: block; }

@media (max-width: 768px) {
  .hamburger { display: flex; }

  #main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 78%;
    max-width: 300px;
    background: var(--color-surface);
    box-shadow: -2px 0 12px rgba(0,0,0,0.15);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 70px 20px 20px;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 100;
    overflow-y: auto;
  }
  #main-nav.active { transform: translateX(0); }
  #main-nav a, #main-nav .user-info {
    width: 100%;
    padding: 12px 4px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
  }
  #main-nav .user-info { color: var(--color-surface); font-size: 0.85rem; background: var(--btn-primary); border-bottom: none; padding-left: 20px; }
}

@media (min-width: 769px) {
  #main-nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}
.title { font-weight: 700; font-size: 26px; color: var(--color-primary); }
.info-price { font-weight: 700; color: var(--color-primary); }
/* ---------- Auth ---------- */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--color-bg);
}
.auth-box {
  background: var(--color-surface);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 380px;
}
.auth-box h1 { font-size: 1.3rem; margin-top: 0; text-align: center; color: var(--accent); }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 14px; font-size: 0.9rem; color: var(--color-text-muted); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  margin-top: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 16px;
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}
.form-row-full { grid-column: 1 / -1; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
}
.btn-primary { background: var(--btn-primary); color: #fff; border-color: var(--btn-primary); }
.btn-primary:hover { background: var(--btn-dark); color: #fff; text-decoration: none; }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 0.82rem; background: var(--color-surface); color: var(--color-primary); }
.btn-sm:hover { background: var(--color-surface); }
.btn-link { background: none; border: none; color: var(--color-primary); }

.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 0.9rem; }
.alert-error { background: #fdecea; color: #a12622; }
.alert-success { background: #e9f9ee; color: #16794a; }
.alert-info { background: #e8f1fd; color: #1a56b0; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin-top: 0; font-size: 1.1rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.filters label { margin-bottom: 0; min-width: 150px; }

/* ---------- Table (desktop) / cards (mobile) ---------- */
.order-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.order-table th, .order-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}
.order-table th { background: #fafbfc; color: var(--color-text-muted); font-weight: 600; }
.order-table tr:last-child td { border-bottom: none; }
.order-table tr:hover { background: #f9fafb; }

.desc-cell { max-width: 450px; white-space: normal; overflow-wrap: break-word; }

@media (max-width: 900px) {
  .order-table thead { display: none; }
  .order-table, .order-table tbody, .order-table tr, .order-table td { display: block; width: 100%; background: none; box-shadow: none; }
  .order-table tr {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    padding: 8px 4px;
  }
  .order-table td {
    border-bottom: none;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  .order-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-muted);
    flex-shrink: 0;
  }
}

.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.file-link { font-size: 0.85rem; }

.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--accent);
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  z-index: 40;
}
.fab:hover { color: #fff; text-decoration: none; background: var(--accent-hover); }

.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow-y: auto;
  z-index: 60;
  display: none;
}
.autocomplete-list.active { display: block; }
.autocomplete-item { padding: 8px 12px; cursor: pointer; font-size: 0.9rem; }
.autocomplete-item:hover, .autocomplete-item.active { background: #f0f4fd; }
.autocomplete-item .meta { color: var(--color-text-muted); font-size: 0.78rem; }

.hidden { display: none !important; }

.text-muted { color: var(--color-text-muted); }
.text-right { text-align: right; }
