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

/* ── BUTTONS — always visible, solid colors ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; padding: 0 14px; border-radius: 8px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; white-space: nowrap; border: none;
  text-decoration: none; transition: opacity .15s;
}
.btn-sm { height: 26px; padding: 0 10px; font-size: 11.5px; }
.btn-ghost  { background: #e5e7eb; color: #374151; } .btn-ghost:hover  { background: #d1d5db; }
.btn-primary{ background: #1d4ed8; color: #fff;    } .btn-primary:hover{ background: #1e40af; }
.btn-success{ background: #16a34a; color: #fff;    } .btn-success:hover{ background: #15803d; }
.btn-renew  { background: #0d9488; color: #fff; font-size: 11.5px; } .btn-renew:hover { background: #0f766e; }
.btn-danger { background: #dc2626; color: #fff;    } .btn-danger:hover { background: #b91c1c; }
.btn-warn   { background: #d97706; color: #fff;    } .btn-warn:hover   { background: #b45309; }
.btn-outline{ background: #fff; color: #374151; border: 1.5px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; }
.btn-block  { width: 100%; height: 42px; font-size: 14px; border-radius: 9px; }

/* ── NAVBAR ── */
.navbar {
  background: #1e293b; display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem; height: 52px; position: sticky; top: 0; z-index: 10;
}
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: #f8fafc; white-space: nowrap; }
.nav-links  { display: flex; gap: 3px; flex: 1; }
.nav-link   { padding: 6px 12px; border-radius: 7px; color: #94a3b8; font-size: 12.5px; font-weight: 500; cursor: pointer; border: none; background: none; }
.nav-link:hover { background: #334155; color: #f8fafc; }
.nav-link.active{ background: #3b82f6; color: #fff; }
.nav-user   { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-name   { font-size: 12.5px; font-weight: 500; color: #e2e8f0; }
.role-pill  { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.rp-sa { background: #7c3aed; color: #fff; }
.rp-ad { background: #2563eb; color: #fff; }
.rp-us { background: #475569; color: #fff; }
.btn-logout2 {
  font-size: 11.5px; color: #94a3b8; padding: 4px 10px; border-radius: 6px;
  border: 1px solid #334155; cursor: pointer; background: none;
}
.btn-logout2:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ── LAYOUT ── */
body   { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 13px; background: #f0f2f5; color: #111827; line-height: 1.5; }
.main  { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.footer{ text-align: center; padding: 1.5rem; font-size: 12px; color: #9ca3af; border-top: 1px solid #e5e7eb; margin-top: 3rem; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 10px; margin-bottom: 1.25rem; }
.stat-card  { background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; padding: 12px 16px; }
.stat-label { font-size: 10.5px; color: #6b7280; margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat-val   { font-size: 22px; font-weight: 800; color: #111827; }
.sv-blue  { color: #1d4ed8; } .sv-green { color: #16a34a; } .sv-red { color: #dc2626; }

/* ── TABS ── */
.page-tabs { display: flex; gap: 2px; margin-bottom: 1rem; background: #e5e7eb; border-radius: 9px; padding: 3px; width: fit-content; }
.ptab      { padding: 6px 16px; border-radius: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: #6b7280; border: none; background: none; }
.ptab.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ── TOOLBAR ── */
.toolbar      { display: flex; gap: 8px; margin-bottom: 1rem; align-items: center; flex-wrap: wrap; }
.toolbar input { height: 36px; padding: 0 12px; border-radius: 8px; border: 1.5px solid #d1d5db; font-size: 13px; background: #fff; color: #111; flex: 1; min-width: 160px; }
.toolbar input:focus  { outline: none; border-color: #3b82f6; }
.toolbar select{ height: 36px; padding: 0 10px; border-radius: 8px; border: 1.5px solid #d1d5db; font-size: 12.5px; background: #fff; color: #111; }

/* ── TABLE ── */
.table-wrap { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; overflow-x: auto; }
table  { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th     { background: #f8fafc; padding: 10px 12px; text-align: left; font-size: 10.5px; font-weight: 700; color: #6b7280; border-bottom: 1px solid #e5e7eb; letter-spacing: .5px; text-transform: uppercase; }
td     { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td      { background: #f8fafc; }
.td-mono  { font-family: 'SF Mono', Menlo, monospace; font-size: 11.5px; color: #374151; }
.td-name strong { font-weight: 600; font-size: 13px; display: block; }
.action-row     { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.ext-link       { font-size: 11px; color: #3b82f6; margin-left: 4px; text-decoration: none; }
.empty          { text-align: center; padding: 2.5rem; color: #9ca3af; font-size: 13px; }

/* ── EXPIRY COLORS ── */
.exp-warn   { color: #d97706; font-weight: 700; }
.exp-danger { color: #dc2626; font-weight: 700; }
.exp-expired{ color: #dc2626; text-decoration: line-through; }

/* ── BADGES ── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-teal   { background: #ccfbf1; color: #0f766e; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-pink   { background: #fce7f3; color: #9d174d; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-coral  { background: #fee2e2; color: #991b1b; }

/* ── STATUS ── */
.status-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.status-active   { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }
.status-trial    { background: #fef3c7; color: #92400e; }
.status-pending  { background: #dbeafe; color: #1e40af; }

/* ── ACTION TAG (log) ── */
.action-tag { font-size: 11px; font-family: monospace; background: #f1f5f9; color: #374151; padding: 2px 7px; border-radius: 5px; }

/* ── LOGIN ── */
.login-body  { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 100%); padding: 2rem; }
.login-wrap  { width: 100%; max-width: 380px; }
.login-card  { background: #fff; border-radius: 16px; padding: 2.5rem; }
.login-logo  { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 2rem; font-size: 17px; font-weight: 800; color: #1e293b; }
.login-card h1  { font-size: 20px; font-weight: 800; margin-bottom: 4px; color: #111827; }
.login-card p   { font-size: 12.5px; color: #6b7280; margin-bottom: 1.5rem; }
.login-hint     { text-align: center; font-size: 11.5px; color: #9ca3af; margin-top: 14px; background: #f8fafc; border-radius: 8px; padding: 8px; }

/* ── FORM INPUTS (shared) ── */
.field        { margin-bottom: 0; }
.field label  { display: block; font-size: 11.5px; font-weight: 700; color: #374151; margin-bottom: 5px; }
.field input, .field select, .field textarea,
.f-inp, .inp  {
  width: 100%; height: 38px; padding: 0 11px;
  border-radius: 8px; border: 1.5px solid #e5e7eb;
  font-size: 13px; color: #111; background: #f9fafb;
  transition: border .15s, background .15s;
}
.field input:focus, .field select:focus, .f-inp:focus, .inp:focus {
  outline: none; border-color: #3b82f6; background: #fff;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.field textarea, .f-textarea {
  height: 72px; padding: 9px 11px; resize: vertical; font-family: inherit;
}
.f-hint     { font-weight: 400; color: #9ca3af; font-size: 11px; }
.label-hint { font-weight: 400; color: #9ca3af; }

/* ── ALERTS ── */
.alert       { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; font-weight: 500; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1.5px solid #86efac; }
.alert-danger  { background: #fef2f2; color: #dc2626; border: 1.5px solid #fecaca; }

/* ── FORM LAYOUT ── */
.form-container { max-width: 720px; }
.form-header    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.form-header h1 { font-size: 20px; font-weight: 800; color: #111827; }
.form-card      { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.5rem; }
.form-section   { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #9ca3af; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; }
.form-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 1.25rem; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-actions   { display: flex; gap: 8px; justify-content: flex-end; padding-top: 1rem; border-top: 1px solid #f1f5f9; }

/* ── DETAIL ── */
.detail-container { max-width: 900px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-grid .span2 { grid-column: 1 / -1; }
.detail-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem; }
.detail-card h3 { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #9ca3af; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; }
.detail-table     { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.detail-table td  { padding: 7px 0; border-bottom: 1px solid #f8fafc; }
.detail-table tr:last-child td { border-bottom: none; }
.detail-table td:first-child   { color: #6b7280; width: 40%; font-size: 12px; }
.mono { font-family: 'SF Mono', Menlo, monospace; font-size: 12px; }
.pass-hidden { font-family: monospace; letter-spacing: 2px; }

/* ── USER MGMT ── */
.section-card    { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem; }
.section-card h2 { font-size: 15px; font-weight: 700; margin-bottom: 1rem; color: #111827; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 100;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 12px; padding: 1.5rem;
  width: 100%; max-width: 380px;
}
.modal-box h3 { font-size: 16px; font-weight: 700; margin-bottom: .75rem; color: #111827; }

/* ── RENEW CARDS ── */
.renew-card     { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.1rem; margin-bottom: 10px; }
.renew-card.urgent { border-left: 4px solid #dc2626; border-radius: 0 12px 12px 0; }
.renew-card.warn   { border-left: 4px solid #d97706; border-radius: 0 12px 12px 0; }
.renew-card.ok     { border-left: 4px solid #16a34a; border-radius: 0 12px 12px 0; }
