﻿/* LicenseHub Admin — dark theme */

:root {
    --bg:        #0f1117;
    --bg-card:   #181c25;
    --bg-hover:  #1e2330;
    --bg-input:  #1a1f2b;
    --border:    #2c3347;
    --text:      #e2e8f0;
    --text-dim:  #8892a4;
    --accent:    #6366f1;
    --accent-bg: #1e1e3f;
    --green:     #22c55e;
    --red:       #ef4444;
    --orange:    #f97316;
    --radius:    6px;
    --mono:      "JetBrains Mono", "Fira Code", monospace;
    --sans:      "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
}

.admin-root { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 220px; background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 16px 12px; gap: 4px; flex-shrink: 0;
}

.sidebar-brand { font-weight: 700; font-size: 15px; color: var(--accent); padding: 8px 4px 12px; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

.admin-sidebar a { display: block; padding: 7px 10px; border-radius: var(--radius); color: var(--text-dim); text-decoration: none; transition: background .15s; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--bg-hover); color: var(--text); }

.admin-main { flex: 1; padding: 28px 32px; overflow-y: auto; }
.admin-main h1 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

.empty-layout { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }

.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; width: 360px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }

.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 28px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 120px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-dim); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.data-table tr:hover td { background: var(--bg-hover); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.row-actions { display: flex; align-items: center; gap: 6px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 13px; cursor: pointer; transition: background .15s; text-decoration: none; }
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,.15); }
.btn-small { padding: 4px 10px; font-size: 12px; }

.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select {
    display: block; width: 100%; padding: 7px 10px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 13px; outline: none;
}
.input:focus, input:focus, select:focus { border-color: var(--accent); }
label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; margin-top: 12px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-active { background: rgba(34,197,94,.15); color: var(--green); }
.badge-idle   { background: rgba(148,163,184,.1); color: var(--text-dim); }

.alert-ok    { background: rgba(34,197,94,.1);  border: 1px solid var(--green); color: var(--green); padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; }
.alert-error { background: rgba(239,68,68,.1);  border: 1px solid var(--red);   color: var(--red);   padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; }

.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; }
.panel > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px; user-select: none; }
.panel-body { padding: 12px 14px 16px; border-top: 1px solid var(--border); }

/* ── Customer searchable picker ───────────────────────────────────────────── */
.customer-picker { position: relative; }
.customer-dropdown {
    position: absolute; z-index: 200; top: calc(100% + 2px); left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--accent);
    border-radius: var(--radius); max-height: 220px; overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.customer-dropdown-item {
    display: flex; flex-direction: column; gap: 1px;
    padding: 8px 12px; cursor: pointer;
}
.customer-dropdown-item:hover { background: var(--bg-hover); }
.customer-dropdown-item .item-email { font-size: 11px; color: var(--text-dim); }

code { font-family: var(--mono); font-size: 12px; }

#blazor-error-ui {
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem;
    position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
