/* Valenys License Server — premium admin theme */
:root {
	--accent: #4f46e5;
	--accent-2: #6366f1;
	--accent-soft: #eef2ff;
	--ink: #0f172a;
	--ink-2: #334155;
	--muted: #64748b;
	--line: #e9edf3;
	--bg: #f5f6fb;
	--card: #ffffff;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
	--shadow-lg: 0 10px 30px rgba(16,24,40,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
	font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	background: var(--bg);
	color: var(--ink-2);
	font-size: 14px;
	line-height: 1.55;
	display: flex;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

/* ===== Sidebar ===== */
.sidebar {
	width: 248px;
	background: linear-gradient(180deg, #111827 0%, #0b1120 100%);
	color: #e2e8f0;
	padding: 22px 14px;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	position: sticky;
	top: 0;
	height: 100vh;
}
.brand { padding: 4px 10px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand h2 { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.brand small { color: #8b97ad; font-size: 11px; letter-spacing: .02em; }
.sidebar nav { flex: 1; padding-top: 14px; display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	color: #c3cbda;
	text-decoration: none;
	border-radius: 10px;
	transition: background .15s ease, color .15s ease;
	font-size: 14px;
	font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active {
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
	color: #fff;
	box-shadow: 0 6px 16px rgba(79,70,229,.35);
}
.sidebar-foot {
	margin-top: 12px;
	padding: 14px 12px 4px;
	border-top: 1px solid rgba(255,255,255,.08);
	font-size: 12.5px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.sidebar-foot span { color: #e2e8f0; font-weight: 600; }
.sidebar-foot a { color: #8b97ad; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }

/* ===== Content ===== */
.content { flex: 1; padding: 34px 38px; max-width: calc(100% - 248px); overflow-x: auto; }
h1 { font-size: 24px; font-weight: 700; margin-bottom: 18px; color: var(--ink); letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 650; margin-bottom: 12px; color: var(--ink); }
h3 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.page-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 22px;
	flex-wrap: wrap;
	gap: 12px;
}

/* ===== Stats (premium: no side-tab; accent value + soft glow) ===== */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 18px;
	margin-bottom: 26px;
}
.stat-card {
	position: relative;
	background: var(--card);
	padding: 20px 22px;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--line);
	overflow: hidden;
	transition: transform .15s, box-shadow .15s;
	--c: var(--accent);
}
.stat-card::before {
	content: '';
	position: absolute;
	inset: 0 auto 0 0;
	width: 4px;
	border-radius: var(--radius) 0 0 var(--radius);
	background: linear-gradient(180deg, var(--c), transparent);
	opacity: .9;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card.stat-blue   { --c: #6366f1; }
.stat-card.stat-green  { --c: #10b981; }
.stat-card.stat-orange { --c: #f59e0b; }
.stat-card.stat-purple { --c: #8b5cf6; }
.stat-card.stat-pink   { --c: #ec4899; }
.stat-value { font-size: 30px; font-weight: 750; color: var(--ink); line-height: 1.05; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: 11.5px; margin-top: 8px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* ===== Grids ===== */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== Panels ===== */
.panel {
	background: var(--card);
	padding: 22px;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	border: 1px solid var(--line);
}
.panel-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 14px;
}

/* ===== Toolbar (search + actions) ===== */
.toolbar {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.search-box { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.search-box input {
	width: 100%;
	padding: 10px 14px 10px 38px;
	border: 1px solid var(--line);
	border-radius: 10px;
	font-size: 14px;
	background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='7' cy='7' r='5'/><line x1='15' y1='15' x2='11' y2='11'/></svg>") no-repeat 12px center;
	box-shadow: var(--shadow);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.toolbar .btn-link.clear { white-space: nowrap; }
.result-count { color: var(--muted); font-size: 12.5px; }

/* ===== Tables ===== */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
	background: #fafbfe;
	color: var(--muted);
	font-weight: 700;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--line);
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbff; }
.table.table-sm thead th, .table.table-sm tbody td { padding: 8px 12px; font-size: 12px; }
.table .empty { text-align: center; color: #94a3b8; padding: 30px; font-style: italic; }
.table a { color: var(--accent); text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }
.table code { background: #f1f3f9; padding: 2px 7px; border-radius: 5px; font-size: 12px; color: var(--ink-2); }

/* ===== Pagination ===== */
.pager { display: flex; align-items: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span {
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 9px;
	border: 1px solid var(--line);
	background: var(--card);
	color: var(--ink-2);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .disabled { opacity: .4; pointer-events: none; }
.pager .gap { border: none; background: none; }

/* ===== Badges ===== */
.badge {
	display: inline-block;
	padding: 4px 10px;
	background: var(--accent-soft);
	color: #4338ca;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: capitalize;
	letter-spacing: .02em;
}
.badge.badge-active    { background: #dcfce7; color: #15803d; }
.badge.badge-expired   { background: #fef3c7; color: #b45309; }
.badge.badge-revoked   { background: #fee2e2; color: #b91c1c; }
.badge.badge-suspended { background: #ffedd5; color: #c2410c; }
.badge.badge-inactive  { background: #f1f5f9; color: #64748b; }

/* ===== Buttons ===== */
.btn-primary, .btn-danger, .btn-link, .btn-sm {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 18px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 9px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: all .15s;
	font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.28); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(79,70,229,.36); }
.btn-danger  { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-link    { color: var(--muted); background: transparent; }
.btn-link:hover { color: var(--ink); }
.btn-sm { padding: 5px 12px; font-size: 12px; background: #eef1f7; color: var(--ink-2); border-radius: 8px; }
.btn-sm:hover { background: #e2e7f1; }
.btn-sm.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-sm.btn-danger:hover { background: #fecaca; }

/* ===== Forms ===== */
.form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	background: var(--card);
	padding: 28px;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	border: 1px solid var(--line);
}
.form-row { display: flex; flex-direction: column; }
.form-row.form-row-full { grid-column: 1 / -1; }
.form-row label { font-weight: 600; font-size: 11.5px; color: var(--ink-2); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .04em; }
.form-row input, .form-row select, .form-row textarea {
	padding: 10px 13px;
	border: 1px solid #cdd5e1;
	border-radius: 9px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.form-row small { color: var(--muted); font-size: 12px; margin-top: 5px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 12px; margin-top: 8px; }

/* ===== Alerts (premium: tinted, soft) ===== */
.alert { padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; }
.alert.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.info-box {
	background: var(--accent-soft);
	border: 1px solid #dfe3fb;
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 20px;
	font-size: 13px;
	color: #3730a3;
}
.info-box code { background: rgba(0,0,0,0.06); padding: 1px 6px; border-radius: 3px; }

/* ===== Filters ===== */
.filters { margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.filter {
	padding: 7px 15px;
	background: var(--card);
	color: var(--ink-2);
	text-decoration: none;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	border: 1px solid var(--line);
}
.filter:hover { background: #f1f5f9; }
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ===== Key-value table (details) ===== */
.key-value { width: 100%; }
.key-value th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 9px 0; width: 40%; }
.key-value td { padding: 9px 0; font-size: 13px; }
.key-value tr { border-bottom: 1px solid var(--line); }
.key-value code { background: #f1f3f9; padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-right: 4px; }

/* ===== Login ===== */
body.login-page { background: radial-gradient(1200px 600px at 50% -10%, #1e293b 0%, #0b1120 60%); justify-content: center; align-items: center; }
.login-box {
	background: var(--card);
	padding: 40px;
	border-radius: 18px;
	box-shadow: 0 30px 60px -15px rgba(0,0,0,.55);
	width: 100%;
	max-width: 400px;
}
.login-box h1 { font-size: 22px; text-align: center; }
.login-box .login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box label { font-weight: 600; font-size: 12px; color: var(--ink-2); text-transform: uppercase; }
.login-box input { padding: 11px 14px; border: 1px solid #cdd5e1; border-radius: 9px; font-size: 15px; }
.login-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.login-box button { padding: 12px; font-size: 15px; font-weight: 700; }
.login-box .login-foot { text-align: center; color: #94a3b8; margin-top: 16px; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
	body { flex-direction: column; }
	.sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
	.sidebar nav { flex-direction: row; flex-wrap: wrap; padding-top: 0; }
	.sidebar-foot { margin: 0; border: none; }
	.content { max-width: 100%; padding: 20px; }
	.form-grid { grid-template-columns: 1fr; }
}
