/* ============================================================
   WebCraft.ge — Admin Panel Styles (Black / Red theme)
   ============================================================ */

:root {
    --bg: #070709;
    --bg2: #0b0b0f;
    --panel: #0f0f15;
    --panel2: #14141c;
    --line: rgba(255, 255, 255, .08);
    --line2: rgba(255, 255, 255, .15);
    --text: #f5f5f7;
    --muted: #a0a0ae;
    --muted2: #6d6d7b;
    --red: #e6192e;
    --red2: #ff3b4d;
    --grad: linear-gradient(135deg, #ff4152 0%, #e6192e 45%, #a30d1d 100%);
    --shadow-red: 0 10px 36px rgba(230, 25, 46, .25);
    --radius: 14px;
    --sidebar-w: 262px;
    --font: 'Noto Sans Georgian', 'Segoe UI', Tahoma, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.i { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; }
.i.flip { transform: rotate(180deg); }

/* ================= ლოგინი ================= */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 60% 50% at 70% 20%, rgba(230, 25, 46, .12), transparent),
        radial-gradient(ellipse 50% 40% at 20% 90%, rgba(120, 10, 25, .16), transparent),
        var(--bg);
    position: relative;
    overflow: hidden;
    padding: 24px;
}
.login-glow { position: absolute; border-radius: 50%; filter: blur(110px); pointer-events: none; }
.lg-1 { width: 480px; height: 480px; background: rgba(230, 25, 46, .13); top: -140px; right: -80px; }
.lg-2 { width: 380px; height: 380px; background: rgba(120, 10, 25, .2); bottom: -120px; left: -60px; }

.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.login-card {
    background: linear-gradient(165deg, rgba(20, 20, 28, .92), rgba(13, 13, 19, .95));
    border: 1px solid var(--line2);
    border-radius: 22px;
    padding: 42px 38px 34px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
    backdrop-filter: blur(14px);
    animation: rise .5s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.login-logo { display: flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 800; justify-content: center; margin-bottom: 26px; }
.logo-mark {
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--grad);
    color: #fff;
    box-shadow: var(--shadow-red);
}
.logo-mark .i { width: 21px; height: 21px; }
.logo-text em { font-style: normal; color: var(--red2); }
.logo-text b { font-weight: 400; color: var(--muted2); font-size: .72em; }
.login-card h1 { font-size: 22px; font-weight: 800; text-align: center; }
.login-card > p { text-align: center; color: var(--muted2); font-size: 14px; margin: 6px 0 26px; }
.login-back {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 22px;
    color: var(--muted2); font-size: 13.5px;
    transition: color .2s;
}
.login-back:hover { color: var(--red2); }

/* ================= ველები ================= */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--line2);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    transition: all .2s;
    resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted2); }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--red);
    background: rgba(230, 25, 46, .04);
    box-shadow: 0 0 0 3px rgba(230, 25, 46, .12);
}
.field select option { background: var(--panel); color: var(--text); }
.field-error, .alert { display: block; }

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-error { background: rgba(230, 25, 46, .1); border-color: rgba(230, 25, 46, .4); color: #ff98a1; }
.alert-success { background: rgba(46, 160, 67, .1); border-color: rgba(46, 160, 67, .35); color: #7ee08d; }

/* ================= ღილაკები ================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 12px 24px;
    border-radius: 11px;
    font-size: 14px; font-weight: 700;
    border: 1px solid transparent;
    transition: all .22s ease;
    white-space: nowrap;
}
.btn-red { background: var(--grad); color: #fff; box-shadow: var(--shadow-red); }
.btn-red:hover { transform: translateY(-2px); box-shadow: 0 16px 46px rgba(230, 25, 46, .4); }
.btn-ghost { background: rgba(255, 255, 255, .04); border-color: var(--line2); color: var(--text); }
.btn-ghost:hover { border-color: var(--red); color: var(--red2); }
.btn-sm { padding: 9px 17px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ================= ლეიაუტი ================= */
.admin-body { min-height: 100vh; }

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg2);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform .28s ease;
}
.side-top { padding: 22px 20px 16px; border-bottom: 1px solid var(--line); }
.side-logo { display: flex; align-items: center; gap: 11px; font-size: 18.5px; font-weight: 800; }
.side-caption {
    display: block;
    margin: 10px 0 0 53px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--red2);
}
.side-nav { flex: 1; padding: 16px 12px; overflow-y: auto; display: grid; gap: 3px; align-content: start; }
.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
    border: 1px solid transparent;
}
.side-link .i { width: 18px; height: 18px; color: var(--muted2); transition: color .2s; }
.side-link:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.side-link:hover .i { color: var(--red2); }
.side-link.active {
    background: linear-gradient(90deg, rgba(230, 25, 46, .16), rgba(230, 25, 46, .05));
    border-color: rgba(230, 25, 46, .3);
    color: #fff;
}
.side-link.active .i { color: var(--red2); }
.side-link.danger:hover { color: var(--red2); }
.side-badge {
    margin-left: auto;
    min-width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 7px;
    border-radius: 100px;
    background: var(--grad);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(230, 25, 46, .5); }
    50% { box-shadow: 0 0 0 6px rgba(230, 25, 46, 0); }
}
.side-bottom { padding: 14px 12px; border-top: 1px solid var(--line); display: grid; gap: 3px; }

.admin-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.admin-topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 30px;
    height: 72px;
    background: rgba(7, 7, 9, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}
.admin-title { font-size: 19px; font-weight: 800; flex: 1; }
.side-toggle {
    display: none;
    width: 42px; height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line2);
    color: var(--text);
    align-items: center;
    justify-content: center;
}
.admin-user { display: flex; align-items: center; gap: 11px; }
.admin-avatar {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-weight: 800;
}
.admin-name { font-weight: 700; font-size: 14px; }

.admin-content { padding: 30px; flex: 1; }

/* flash */
.flash {
    margin: 18px 30px 0;
    padding: 13px 17px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    animation: flashIn .3s ease both;
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.flash-success { background: rgba(46, 160, 67, .1); border: 1px solid rgba(46, 160, 67, .35); color: #7ee08d; }
.flash-error { background: rgba(230, 25, 46, .1); border: 1px solid rgba(230, 25, 46, .4); color: #ff98a1; }
.flash .i { width: 18px; height: 18px; }

/* ================= დაშბორდი ================= */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(165deg, var(--panel2), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    transition: all .25s;
}
.stat-card:hover { border-color: rgba(230, 25, 46, .4); transform: translateY(-3px); }
.sc-ic {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line2);
    color: var(--muted);
    flex-shrink: 0;
}
.sc-ic .i { width: 24px; height: 24px; }
.sc-ic.red { background: rgba(230, 25, 46, .12); border-color: rgba(230, 25, 46, .35); color: var(--red2); }
.sc-ic.pulse {
    background: rgba(230, 25, 46, .12);
    border-color: rgba(230, 25, 46, .35);
    color: var(--red2);
    animation: scPulse 2s infinite;
}
@keyframes scPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(230, 25, 46, .35); }
    50% { box-shadow: 0 0 0 8px rgba(230, 25, 46, 0); }
}
.stat-card b { display: block; font-size: 26px; font-weight: 900; line-height: 1.2; }
.stat-card span { font-size: 13px; color: var(--muted2); }

.panel-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.panel {
    background: linear-gradient(165deg, var(--panel2), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 22px;
}
.panel-narrow { max-width: 520px; }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.panel-head h2 { font-size: 16.5px; font-weight: 800; }
.panel-link {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13.5px; font-weight: 700;
    color: var(--red2);
    transition: opacity .2s;
}
.panel-link:hover { opacity: .75; }
.panel-tag {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    padding: 6px 13px;
    border-radius: 100px;
}

/* CSS bar chart */
.chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    align-items: end;
    height: 210px;
}
.chart-col { display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-count { font-size: 12.5px; font-weight: 800; color: var(--red2); min-height: 18px; }
.chart-bar-zone { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar {
    width: min(46px, 78%);
    border-radius: 8px 8px 3px 3px;
    background: var(--grad);
    box-shadow: 0 6px 20px rgba(230, 25, 46, .3);
    transition: height .5s ease;
    min-height: 6px;
}
.chart-label { font-size: 12px; color: var(--muted2); margin-top: 9px; }

.mini-orders { display: grid; gap: 6px; }
.mini-order {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 12px;
    border-radius: 11px;
    transition: background .2s;
}
.mini-order:hover { background: rgba(255, 255, 255, .03); }
.mo-avatar {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(230, 25, 46, .14);
    color: var(--red2);
    font-weight: 800;
    flex-shrink: 0;
}
.mo-info { flex: 1; min-width: 0; line-height: 1.35; }
.mo-info b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.new-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--red2);
    animation: badgePulse 2s infinite;
}
.mo-info em { font-style: normal; font-size: 12.5px; color: var(--muted2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-phone { font-size: 13px; color: var(--muted); }
.mo-phone:hover { color: var(--red2); }

/* ================= ცხრილები ================= */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted2);
    padding: 11px 14px;
    border-bottom: 1px solid var(--line2);
    white-space: nowrap;
}
.admin-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.admin-table tbody tr { transition: background .18s; }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.td-strong { font-weight: 700; }
.td-dim { color: var(--muted); font-size: 13.5px; }
.td-sub { display: block; font-size: 12.5px; color: var(--muted2); }
.td-price { font-weight: 800; color: var(--red2); }
.td-price s { font-weight: 400; color: var(--muted2); margin-left: 5px; }
.td-msg { max-width: 340px; }
.td-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nowrap { white-space: nowrap; }
.th-actions, .td-actions { text-align: right; white-space: nowrap; }
.td-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.inline-form { display: inline-flex; }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line2);
    color: var(--muted);
    transition: all .2s;
    cursor: pointer;
}
.icon-btn .i { width: 16px; height: 16px; }
.icon-btn:hover { color: #fff; background: var(--grad); border-color: transparent; box-shadow: var(--shadow-red); }
.icon-btn.danger:hover { background: rgba(230, 25, 46, .18); border-color: rgba(230, 25, 46, .5); color: var(--red2); box-shadow: none; }

.table-thumb {
    width: 64px; height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line2);
}
.empty-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(230, 25, 46, .1);
    color: var(--red2);
    font-weight: 800;
}
.cat-chip {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--red2);
    background: rgba(230, 25, 46, .1);
    border: 1px solid rgba(230, 25, 46, .3);
    padding: 3px 11px;
    border-radius: 100px;
    margin-left: 6px;
    white-space: nowrap;
}
.icon-chip {
    display: inline-flex;
    width: 34px; height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(230, 25, 46, .1);
    color: var(--red2);
    border: 1px solid rgba(230, 25, 46, .25);
}
.icon-chip .i { width: 16px; height: 16px; }

.status {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 100px;
}
.st-new {
    background: rgba(230, 25, 46, .14);
    color: #ff8a94;
    border: 1px solid rgba(230, 25, 46, .45);
    animation: badgePulse 2s infinite;
}
.st-read { background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--line2); }
.row-new td { background: rgba(230, 25, 46, .03); }

/* ================= ფორმები ================= */
.admin-form { padding-bottom: 4px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 18px;
}
.field-full { grid-column: 1 / -1; }
.checkbox-field { display: flex; align-items: flex-end; padding-bottom: 16px; }
.chk { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600 !important; color: var(--text) !important; }
.chk input { width: 18px; height: 18px; accent-color: var(--red); }
.file-input { padding: 10px 14px !important; }
.file-input::file-selector-button {
    margin-right: 14px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--grad);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}
.img-preview {
    margin-top: 12px;
    max-height: 170px;
    border-radius: 10px;
    border: 1px solid var(--line2);
}
.sep { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.admin-form .btn { margin-top: 8px; }

.empty {
    color: var(--muted2);
    font-size: 14px;
    padding: 30px 10px;
    text-align: center;
}

/* settings */
.settings-group { margin-bottom: 26px; }
.sg-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15.5px;
    font-weight: 800;
    color: var(--red2);
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); box-shadow: 30px 0 80px rgba(0, 0, 0, .5); }
    .sidebar.open { transform: none; }
    .admin-main { margin-left: 0; }
    .side-toggle { display: flex; }
    .admin-content { padding: 18px; }
    .admin-topbar { padding: 0 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .admin-table { display: block; overflow-x: auto; }
    .td-msg { max-width: 220px; }
    .admin-name { display: none; }
}
