/* Маркетплейс услуг draytny.ru - Mobile-first */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
input, select, textarea, button { font: inherit; }
button { cursor: pointer; }

/* Layout */
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; padding: 1rem; padding-bottom: 5rem; }
.header { background: var(--card); padding: 1rem; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header h1 { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.header-sub { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }

/* Nav */
.nav-bottom { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: .5rem 0; z-index: 100; }
.nav-bottom a { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); font-size: .7rem; padding: .25rem .5rem; }
.nav-bottom a.active, .nav-bottom a:hover { color: var(--primary); }
.nav-bottom svg { width: 24px; height: 24px; margin-bottom: .2rem; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.card-title { font-weight: 600; margin-bottom: .5rem; }
.card-meta { font-size: .85rem; color: var(--text-muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .6rem 1.2rem; border-radius: 8px; font-weight: 500; border: none; transition: all .2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: .4rem .8rem; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 500; margin-bottom: .4rem; }
.form-input, .form-select, .form-textarea { width: 100%; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 8px; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-textarea { min-height: 100px; resize: vertical; }

/* Search */
.search-bar { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-bar input, .search-bar select { flex: 1; min-width: 120px; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-chip { padding: .4rem .8rem; background: var(--card); border: 1px solid var(--border); border-radius: 20px; font-size: .85rem; cursor: pointer; }
.filter-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Executor card */
.executor-card { display: flex; gap: 1rem; padding: 1rem; background: var(--card); border-radius: var(--radius); margin-bottom: .75rem; box-shadow: var(--shadow); }
.executor-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* Grid 3x4 */
.executor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.executor-cube { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .2s; }
.executor-cube:hover { transform: translateY(-2px); text-decoration: none; color: inherit; }
.executor-cube img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.executor-cube .cube-body { padding: .6rem; flex: 1; }
.executor-cube .cube-name { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.executor-cube .cube-rating { color: var(--accent); font-size: .8rem; }
.executor-cube .cube-meta { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.executor-cube .cube-keywords { font-size: .7rem; color: var(--text-muted); margin-top: .3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-cube { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 2px dashed var(--border); border-radius: var(--radius); min-height: 180px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: .85rem; text-align: center; padding: 1rem; }
.ad-cube.real { border-style: solid; background: var(--card); }
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin: 1.5rem 0; }
.pagination a, .pagination span { padding: .4rem .7rem; border-radius: 6px; font-size: .9rem; text-decoration: none; }
.pagination a { background: var(--card); color: var(--primary); border: 1px solid var(--border); }
.pagination a:hover { background: var(--primary); color: white; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: white; border: 1px solid var(--primary); }
@media (max-width: 400px) { .executor-grid { grid-template-columns: repeat(2, 1fr); } }
.executor-info { flex: 1; min-width: 0; }
.executor-name { font-weight: 600; margin-bottom: .2rem; }
.executor-rating { color: var(--accent); font-size: .9rem; }
.executor-meta { font-size: .85rem; color: var(--text-muted); margin-top: .3rem; }
.executor-keywords { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.executor-keyword { font-size: .75rem; padding: .2rem .5rem; background: var(--bg); border-radius: 4px; color: var(--text-muted); }

/* Order status */
.status-badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .8rem; font-weight: 500; }
.status-created { background: #fef3c7; color: #92400e; }
.status-accepted { background: #dbeafe; color: #1e40af; }
.status-in_progress { background: #e0e7ff; color: #3730a3; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-accepted_by_customer { background: #d1fae5; color: #047857; }

/* Chat */
.chat-messages { max-height: 400px; overflow-y: auto; padding: 1rem; }
.chat-msg { display: flex; margin-bottom: 1rem; }
.chat-msg.sent { flex-direction: row-reverse; }
.chat-msg .bubble { max-width: 80%; padding: .6rem 1rem; border-radius: 16px; }
.chat-msg.received .bubble { background: var(--border); border-bottom-left-radius: 4px; }
.chat-msg.sent .bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.chat-msg .time { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; }
.chat-input { display: flex; gap: .5rem; padding: 1rem; background: var(--card); border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }

/* Auth */
.auth-screen { max-width: 360px; margin: 2rem auto; text-align: center; padding: 2rem; }
.auth-screen h1 { margin-bottom: 1rem; }
.auth-screen p { color: var(--text-muted); margin-bottom: 1.5rem; }
.telegram-login { margin: 1rem 0; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 1rem; opacity: .5; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (min-width: 640px) { .app { max-width: 640px; } .grid-2 { grid-template-columns: repeat(3, 1fr); } }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--text); color: white; padding: 1rem; }
.admin-sidebar a { color: rgba(255,255,255,.8); display: block; padding: .5rem 0; }
.admin-sidebar a:hover { color: white; }
.admin-content { padding: 1.5rem; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: .5rem; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { font-weight: 600; background: var(--bg); }
@media (max-width: 768px) { .admin-layout { grid-template-columns: 1fr; } }
