/* LicenseGuard - Custom Styles */

/* ── Layout ── */
.sidebar { transition: width 0.3s ease, transform 0.3s ease; }
.sidebar.collapsed { width: 0; overflow: hidden; }
@media (max-width: 768px) { .sidebar { position: fixed; height: 100%; transform: translateX(-100%); } .sidebar.open { transform: translateX(0); } }

/* ── Navigation Items ── */
.nav-item {
  display: flex; align-items: center; gap: 0.625rem; width: 100%;
  padding: 0.5rem 0.75rem; border-radius: 0.5rem;
  font-size: 0.8125rem; font-weight: 500; color: #94a3b8;
  transition: all 0.15s ease; cursor: pointer; background: transparent; border: none; text-align: left;
}
.nav-item:hover { background: rgba(51,65,85,0.6); color: #e2e8f0; }
.nav-item.active { background: rgba(37,99,235,0.15); color: #60a5fa; }
.dark .nav-item.active { background: rgba(37,99,235,0.2); }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: #2563eb; color: #fff; border: none; border-radius: 0.5rem;
  padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.35); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: rgba(51,65,85,0.6); color: #cbd5e1; border: 1px solid #334155;
  border-radius: 0.5rem; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-secondary:hover { background: rgba(71,85,105,0.7); color: #e2e8f0; }
.btn-warning {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: rgba(217,119,6,0.2); color: #fbbf24; border: 1px solid rgba(217,119,6,0.4);
  border-radius: 0.5rem; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-warning:hover { background: rgba(217,119,6,0.35); }
.btn-success {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: rgba(5,150,105,0.2); color: #34d399; border: 1px solid rgba(5,150,105,0.4);
  border-radius: 0.5rem; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-success:hover { background: rgba(5,150,105,0.35); }
.btn-sm { padding: 0.35rem 0.75rem !important; font-size: 0.75rem !important; }

/* ── Input Fields ── */
.input-field {
  background: rgba(15,23,42,0.7); border: 1px solid #334155; border-radius: 0.5rem;
  padding: 0.5rem 0.75rem; font-size: 0.875rem; color: #e2e8f0;
  transition: border-color 0.15s ease; outline: none;
}
.input-field:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
.input-field::placeholder { color: #475569; }

/* ── KPI Cards ── */
.kpi-card {
  background: rgba(30,41,59,0.8); border: 1px solid #1e3a5f33;
  border-radius: 1rem; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem;
  backdrop-filter: blur(8px); transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.kpi-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.625rem; display: flex; align-items: center; justify-content: center; }
.kpi-value { font-size: 1.75rem; font-weight: 700; color: #f1f5f9; line-height: 1; }
.kpi-label { font-size: 0.75rem; color: #64748b; font-weight: 500; }

/* ── Chart Cards ── */
.chart-card {
  background: rgba(30,41,59,0.8); border: 1px solid rgba(51,65,85,0.5);
  border-radius: 1rem; overflow: hidden; backdrop-filter: blur(8px);
}
.chart-header { padding: 1rem 1.25rem; border-bottom: 1px solid rgba(51,65,85,0.5); }
.chart-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; color: #e2e8f0; }
.chart-body { padding: 1.25rem; }

/* ── Content Cards / Table Wrappers ── */
.content-card { background: rgba(30,41,59,0.8); border: 1px solid rgba(51,65,85,0.5); border-radius: 1rem; overflow: hidden; }
.content-card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid rgba(51,65,85,0.5); flex-wrap: wrap; gap: 0.75rem; }
.section-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; font-weight: 600; color: #e2e8f0; }
.table-wrapper { overflow-x: auto; }

/* ── Data Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.data-table thead th {
  padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 600;
  color: #64748b; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(51,65,85,0.5); white-space: nowrap; cursor: default;
}
.data-table thead th.sortable { cursor: pointer; transition: color 0.15s; }
.data-table thead th.sortable:hover { color: #94a3b8; }
.data-table tbody tr {
  border-bottom: 1px solid rgba(51,65,85,0.3); transition: background 0.12s; cursor: pointer;
}
.data-table tbody tr:hover { background: rgba(51,65,85,0.3); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody td { padding: 0.75rem 1rem; color: #cbd5e1; vertical-align: middle; }

/* ── Status Badges ── */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-active { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-inactive { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-disabled { background: rgba(100,116,139,0.15); color: #64748b; border: 1px solid rgba(100,116,139,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-license { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }
.badge-premium { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.permission-badge { padding: 0.2rem 0.6rem; background: rgba(29,78,216,0.2); color: #93c5fd; font-size: 0.7rem; border-radius: 9999px; border: 1px solid rgba(29,78,216,0.4); }

/* ── Utilization Bar ── */
.util-bar { height: 6px; background: rgba(51,65,85,0.6); border-radius: 3px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.util-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.util-fill.high { background: #ef4444; }
.util-fill.medium { background: #f59e0b; }
.util-fill.low { background: #10b981; }

/* ── Insight Cards ── */
.insight-card {
  background: rgba(30,41,59,0.8); border: 1px solid rgba(51,65,85,0.5);
  border-radius: 1rem; padding: 1.25rem; display: flex; gap: 1rem; align-items: flex-start;
  transition: transform 0.2s, box-shadow 0.2s;
}
.insight-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.insight-icon { flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; }
.insight-severity-critical { border-left: 3px solid #ef4444; }
.insight-severity-high { border-left: 3px solid #f59e0b; }
.insight-severity-medium { border-left: 3px solid #3b82f6; }
.insight-severity-low { border-left: 3px solid #10b981; }

/* ── Report Cards ── */
.report-card {
  background: rgba(30,41,59,0.8); border: 1px solid rgba(51,65,85,0.5);
  border-radius: 1rem; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.report-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.report-icon { width: 3rem; height: 3rem; border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; }
.report-title { font-size: 0.9375rem; font-weight: 600; color: #e2e8f0; }
.report-desc { font-size: 0.8125rem; color: #64748b; line-height: 1.5; flex: 1; }

/* ── Toast Notifications ── */
.toast {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.125rem; border-radius: 0.75rem; min-width: 280px; max-width: 400px;
  backdrop-filter: blur(12px); border: 1px solid; pointer-events: all;
  animation: slideIn 0.3s ease-out;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.toast-success { background: rgba(5,150,105,0.15); border-color: rgba(16,185,129,0.4); color: #34d399; }
.toast-error { background: rgba(220,38,38,0.15); border-color: rgba(239,68,68,0.4); color: #f87171; }
.toast-warning { background: rgba(217,119,6,0.15); border-color: rgba(245,158,11,0.4); color: #fbbf24; }
.toast-info { background: rgba(37,99,235,0.15); border-color: rgba(59,130,246,0.4); color: #60a5fa; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Page Sections ── */
.page-section { animation: fadeIn 0.25s ease-out; }

/* ── Light Mode Overrides ── */
html:not(.dark) body { background-color: #f1f5f9; color: #0f172a; }
html:not(.dark) .kpi-card { background: rgba(255,255,255,0.9); border-color: #e2e8f0; }
html:not(.dark) .chart-card { background: rgba(255,255,255,0.9); border-color: #e2e8f0; }
html:not(.dark) .content-card { background: rgba(255,255,255,0.9); border-color: #e2e8f0; }
html:not(.dark) #sidebar { background: #fff; border-color: #e2e8f0; }
html:not(.dark) header { background: rgba(255,255,255,0.9); border-color: #e2e8f0; }
html:not(.dark) .nav-item { color: #475569; }
html:not(.dark) .nav-item:hover { background: #f1f5f9; color: #1e293b; }
html:not(.dark) .nav-item.active { background: rgba(37,99,235,0.1); color: #2563eb; }
html:not(.dark) .kpi-value { color: #0f172a; }
html:not(.dark) .data-table tbody td { color: #334155; }
html:not(.dark) .data-table tbody tr:hover { background: #f8fafc; }
html:not(.dark) .input-field { background: #fff; border-color: #e2e8f0; color: #0f172a; }
html:not(.dark) .btn-secondary { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
html:not(.dark) .insight-card { background: rgba(255,255,255,0.9); border-color: #e2e8f0; }
html:not(.dark) .report-card { background: rgba(255,255,255,0.9); border-color: #e2e8f0; }
html:not(.dark) #user-modal > div,
html:not(.dark) #config-modal > div,
html:not(.dark) #rates-modal > div { background: #fff; border-color: #e2e8f0; }
html:not(.dark) .kpi-label, html:not(.dark) .report-desc { color: #94a3b8; }
html:not(.dark) .data-table thead th { color: #94a3b8; }
html:not(.dark) .chart-title { color: #1e293b; }
html:not(.dark) .section-title { color: #1e293b; }
html:not(.dark) ::-webkit-scrollbar-thumb { background: #cbd5e1; }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 0.8s linear infinite; }
