/* ЗАКАЗЫ USA — стили (общие для login и app) */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; font-size: 14px; color: #1a1a1a; background: #f5f6f8; }

/* Login screen */
.login-bg { position: fixed; inset: 0; background: linear-gradient(135deg,#eef2ff 0%,#f5f6f8 60%); display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; padding: 28px 28px 24px; border-radius: 12px; width: 380px; box-shadow: 0 12px 36px rgba(0,0,0,.10); }
.login-card .brand { font-size: 20px; font-weight: 800; color: #1e1b4b; margin-bottom: 14px; }
.login-card h2 { margin: 0 0 4px; font-size: 22px; }
.login-card p { margin: 0 0 18px; color: #6b7280; font-size: 13px; }
.login-card label { display: block; font-size: 12px; color: #4b5563; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; }
.login-card input:focus { outline: 2px solid #4f46e5; outline-offset: -1px; }
.login-card button { width: 100%; margin-top: 16px; padding: 10px; background: #4f46e5; color: #fff; border: 0; border-radius: 6px; font-weight: 600; cursor: pointer; }
.login-card button:hover { background: #4338ca; }
.login-card button:disabled { background: #c7d2fe; cursor: wait; }
.login-err { color: #dc2626; margin-top: 10px; font-size: 13px; min-height: 18px; }

/* App layout */
.app { display: grid; grid-template-columns: 240px 1fr; height: 100vh; }
.main { overflow: auto; padding: 18px 22px; }
.sidebar { background: #fff; border-right: 1px solid #e5e7eb; padding: 0; display: flex; flex-direction: column; }
.sidebar-brand { padding: 14px 16px 10px; border-bottom: 1px solid #e5e7eb; }
.sidebar-brand .name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: #1e1b4b; }
.sidebar-brand .sub { font-size: 10px; color: #9ca3af; margin-top: 3px; text-transform: uppercase; letter-spacing: .06em; }
.sidebar h1 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin: 8px 16px 6px; font-weight: 600; }
.nav-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; cursor: pointer; border-left: 3px solid transparent; user-select: none; }
.nav-item:hover { background: #f5f6f8; }
.nav-item.active { background: #eef2ff; border-left-color: #4f46e5; font-weight: 600; color: #1e1b4b; }
.nav-item.hidden { display: none; }
.nav-item .count { color: #9ca3af; font-size: 12px; }
.session-bar { margin-top: auto; padding: 10px 16px; border-top: 1px solid #e5e7eb; font-size: 12px; color: #4b5563; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.session-bar .who { font-weight: 600; }
.session-bar .role { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: #eef2ff; color: #4338ca; text-transform: uppercase; letter-spacing: .03em; }
.session-bar button { background: transparent; border: 1px solid #e5e7eb; color: #4b5563; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.session-bar button:hover { background: #f5f6f8; }

h2 { font-size: 18px; margin: 0 0 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
input[type="text"], input[type="search"], input[type="date"], input[type="number"], input[type="email"], input[type="password"], textarea, select {
  font: inherit; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff;
}
input[type="search"] { min-width: 280px; }
button.primary { background: #4f46e5; color: #fff; border: 0; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-weight: 500; }
button.primary:hover { background: #4338ca; }
button.ghost { background: #fff; border: 1px solid #d1d5db; padding: 7px 12px; border-radius: 6px; cursor: pointer; }
button.ghost:hover { background: #f5f6f8; }
button.danger { color: #dc2626; }
.empty { padding: 40px; text-align: center; color: #9ca3af; }

/* Cards (для списка клиентов) */
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.client-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: .12s; }
.client-card:hover { border-color: #4f46e5; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.08); }
.client-card .name { font-weight: 600; margin-bottom: 6px; word-break: break-word; }
.client-card .meta { font-size: 12px; color: #6b7280; }
.client-card .meta .bar { display: inline-block; padding: 2px 6px; border-radius: 4px; background: #f3f4f6; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f1f2f5; vertical-align: top; }
th { background: #fafbfc; font-weight: 600; font-size: 12px; color: #4b5563; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow: auto; max-height: calc(100vh - 160px); border-radius: 8px; }

.breadcrumb { color: #6b7280; font-size: 13px; margin-bottom: 8px; }
.breadcrumb a { color: #4f46e5; cursor: pointer; }
.breadcrumb .sep { margin: 0 6px; color: #d1d5db; }

/* Modals */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; padding: 22px; width: min(560px, 92vw); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 14px; }
.modal label { display: block; font-size: 12px; color: #4b5563; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin: 12px 0 4px; }
.modal input, .modal select, .modal textarea { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.notice { background: #fef3c7; border: 1px solid #fcd34d; color: #78350f; padding: 10px 14px; border-radius: 8px; font-size: 12px; margin: 12px 0; }
.error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 12px 0; }
