/* ── Design tokens (из kit_account_2/.claude/commands/верстка.md) ── */

:root {
    --teal:           #0F766E;
    --teal-bright:    #14B8A6;
    --teal-frost:     #F0FDFA;
    --teal-mist:      #CCFBF1;

    --midnight:       #1A1A1A;
    --charcoal:       #2D2D2D;
    --stone:          #6B7280;
    --stone-light:    #9CA3AF;
    --body-dark:      #111114;
    --page-bg:        #F0F1F3;
    --icon-bg:        #F5F5F4;

    --coral:          #F97066;
    --green:          #22C55E;
    --green-light:    #F0FDF4;
    --green-border:   #BBF7D0;
    --purple:         rgb(139,92,246);
    --amber:          rgb(245,180,50);
    --amber-light:    #FFFBEB;

    --border:         rgba(0,0,0,.06);
    --border-medium:  rgba(0,0,0,.08);
    --border-light:   rgba(255,255,255,.08);

    --font-display:   'Fraunces', Georgia, serif;
    --font-body:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono:      'DM Mono', 'SF Mono', ui-monospace, monospace;

    --sidebar-w:      240px;
    --topbar-h:       56px;

    --radius-sm:      10px;
    --radius:         16px;
    --radius-lg:      24px;

    --shadow-soft:    0 1px 3px rgba(0,0,0,.03), 0 4px 12px rgba(0,0,0,.02);
    --shadow-medium:  0 4px 12px rgba(0,0,0,.05), 0 16px 40px rgba(0,0,0,.04);
    --shadow-btn:     0 4px 16px rgba(15,118,110,.25);
    --ease:           cubic-bezier(.22, 1, .36, 1);
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&family=Fraunces:wght@600;700&display=swap');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    background: var(--page-bg);
    color: var(--midnight);
    font-size: 14px;
    line-height: 1.5;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-bright); }

.sub { color: var(--stone); font-size: 12px; }

/* ── App layout: sidebar + content ── */

.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--body-dark);
    color: #fff;
    padding: 20px 16px;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--border-light);
    position: sticky; top: 0;
    height: 100vh;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}
.sidebar .brand .logo {
    width: 32px; height: 32px;
    background: var(--teal-bright);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700;
    color: #fff;
}
.sidebar .brand .title {
    font-family: var(--font-display); font-size: 17px; font-weight: 700;
}
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
    color: var(--stone-light);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    transition: all .15s var(--ease);
}
.sidebar nav a:hover { background: rgba(255,255,255,.04); color: #fff; }
.sidebar nav a.active { background: rgba(20,184,166,.15); color: #fff; }
.sidebar nav .ico { width: 16px; opacity: .7; }

.sidebar .user-block {
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
}
.sidebar .user-block .name { color: #fff; font-weight: 600; margin-bottom: 4px; }
.sidebar .user-block .actions { display: flex; gap: 6px; margin-top: 6px; }

.content { padding: 24px 32px; min-width: 0; }

/* ── Topbar (внутри content) ── */

.page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; gap: 16px;
}
.page-head h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 24px; font-weight: 700;
}
.page-head .head-actions { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ── */

.btn {
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px;
    border: 0; border-radius: var(--radius-sm);
    background: var(--midnight); color: #fff;
    font-family: inherit; font-size: 13px; font-weight: 600;
    transition: all .2s var(--ease);
    text-decoration: none;
}
.btn:hover { background: var(--charcoal); color: #fff; }
.btn.primary { background: var(--teal-bright); box-shadow: var(--shadow-btn); }
.btn.primary:hover { background: var(--teal); }
.btn.ghost {
    background: #fff; color: var(--midnight);
    border: 1px solid var(--border);
}
.btn.ghost:hover { background: var(--icon-bg); border-color: var(--border-medium); }
.btn.danger { background: var(--coral); }
.btn.danger:hover { background: #DC2626; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.xs { padding: 4px 8px; font-size: 11px; border-radius: 6px; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    transition: border-color .15s var(--ease);
}
input:focus, textarea:focus, select:focus {
    outline: 0;
    border-color: var(--teal-bright);
    box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
textarea { resize: vertical; }

code, .mono {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--icon-bg);
    padding: 1px 6px;
    border-radius: 4px;
}

/* ── Grid of cards ── */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex; flex-direction: column;
    transition: box-shadow .25s var(--ease);
}
.card:hover { box-shadow: var(--shadow-medium); }
.card-frame {
    height: 200px;
    background: var(--icon-bg);
    border-bottom: 1px solid var(--border);
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
}
.card-frame iframe {
    border: 0;
    transform: scale(0.5);
    transform-origin: top left;
    width: 200%;
    height: 400px;
    pointer-events: none;
}
.card-frame .placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--stone-light); font-size: 12px;
}
.card-body { padding: 14px 16px; flex: 1; }
.card-body h3 {
    margin: 0 0 4px;
    font-size: 15px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.card-body .meta { font-size: 12px; color: var(--stone); }
.card-actions {
    display: flex; gap: 6px;
    padding: 8px 16px 16px;
    flex-wrap: wrap;
}
.card-actions .btn.xs { color: var(--midnight); background: #fff; border: 1px solid var(--border); }
.card-actions .btn.xs:hover { background: var(--icon-bg); }
.card-actions .btn.xs.danger { color: var(--coral); border-color: rgba(249,112,102,.3); background: #fff; }
.card-actions .btn.xs.danger:hover { background: #FEF2F2; }

.empty {
    grid-column: 1 / -1;
    background: #fff;
    padding: 60px;
    border-radius: var(--radius);
    text-align: center;
    color: var(--stone);
    border: 1px dashed var(--border-medium);
}

/* ── Dialogs ── */

dialog {
    border: 0; border-radius: var(--radius); padding: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    max-width: 540px; width: 90%;
    font-family: var(--font-body);
}
dialog::backdrop { background: rgba(0,0,0,.4); backdrop-filter: blur(4px); }
.dlg-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.dlg-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.dlg-body { padding: 20px; }
.dlg-body label {
    display: block; font-size: 12px;
    color: var(--stone); margin-bottom: 6px;
    font-weight: 500;
}
.dlg-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex; gap: 8px;
    justify-content: flex-end;
}
.x {
    background: transparent; border: 0;
    font-size: 22px; cursor: pointer;
    color: var(--stone); padding: 4px 10px;
    line-height: 1;
}
.x:hover { color: var(--midnight); }

/* ── Badges ── */

.badge {
    display: inline-flex; padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .3px;
}
.badge.ok      { background: var(--teal-mist); color: var(--teal); }
.badge.wait    { background: #FEF3C7; color: #92400E; }
.badge.missing { background: #E0F2FE; color: #075985; }
.badge.bug     { background: #FBDFD9; color: #991B1B; }
.badge.idea    { background: #F3E8FF; color: #6B21A8; }

/* ── Feedback list ── */

.fb-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.fb-row .fb-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.fb-row .ts { color: var(--stone-light); font-size: 11px; }

/* ── project.html: full-width console layout ── */

.console-wrap {
    flex: 1;
    margin: 0 32px 24px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 0;
}
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tabs button {
    flex: 0 1 auto; padding: 12px 18px;
    background: transparent;
    border: 0; border-bottom: 2px solid transparent;
    font-size: 12px; cursor: pointer; font-family: inherit;
    color: var(--stone); font-weight: 500;
    transition: all .15s var(--ease);
}
.tabs button.active {
    color: var(--midnight);
    border-color: var(--teal-bright);
    font-weight: 600;
}
.tab-body { padding: 16px; flex: 1; overflow: auto; }
.tab-body .item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.tab-body .item:last-child { border-bottom: 0; }
.tab-body .item .ts {
    color: var(--stone-light);
    font-size: 11px;
    margin-top: 2px;
}
.tab-body .item code {
    font-size: 11px;
}

.proj-head {
    padding: 16px 32px;
    display: flex; align-items: center; justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.proj-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px; font-weight: 700;
}
.proj-head .actions { display: flex; gap: 8px; }

/* diff2html overrides */
.tab-body .commit:hover { background: var(--icon-bg); cursor: pointer; }
.tab-body .diff .d2h-wrapper {
    font-size: 11px;
    font-family: var(--font-mono);
}
.tab-body .diff .d2h-file-header {
    padding: 6px 10px;
    font-size: 11px;
}
.tab-body .diff .d2h-diff-table { font-size: 10px; }
