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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  background: linear-gradient(145deg, #080e1a, #0f1b30, #0b1526);
  color: #dce4f0;
  font-size: 14px;
}

/* ── Header ── */
.header {
  background: linear-gradient(90deg, #0b1526, #162d50, #0b1526);
  border-bottom: 2px solid #1e3a5f;
  padding: 14px 20px;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { height: 34px; width: auto; }
.logo-text h1 { font-size: 18px; font-weight: 700; color: #f0f4fa; }
.logo-text p  { font-size: 11px; color: #7a96b8; margin-top: 2px; }

.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.nav a, .nav button {
  color: #7a96b8;
  font-size: 13px;
  font-family: inherit;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,0.06); color: #c0d0e4; }
.nav a.active { background: rgba(30,58,95,0.8); color: #93bbfc; border: 1px solid rgba(147,187,252,0.2); }

.nav-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #7a96b8; padding: 0 8px;
}

/* ── Layout ── */
.main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: #c0d0e4;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* ── Cards de módulos ── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.module-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background .2s, border-color .2s;
}
.module-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(147,187,252,0.2);
}

.module-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.module-card-name   { font-size: 15px; font-weight: 600; color: #e8edf5; }
.module-card-desc   { font-size: 13px; color: #5a7a9a; flex: 1; }
.module-card-footer { margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.module-expire      { font-size: 12px; color: #5a7a9a; }
.module-expire.expired { color: #f59e0b; }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.badge-ativo    { background: rgba(109,216,151,0.12); color: #6dd897; border: 1px solid rgba(109,216,151,0.2); }
.badge-expirado { background: rgba(245,158,11,0.12);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.badge-bloq     { background: rgba(255,255,255,0.05); color: #5a7a9a; border: 1px solid rgba(255,255,255,0.1); }
.badge-soon     { background: rgba(147,187,252,0.1);  color: #93bbfc; border: 1px solid rgba(147,187,252,0.2); }

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, #1e3a5f, #2a5298);
  color: #e8edf5;
  border: 1px solid rgba(147,187,252,0.2);
}
.btn-primary:hover:not(:disabled) { opacity: .88; }

.btn-success {
  background: rgba(109,216,151,0.15);
  color: #6dd897;
  border: 1px solid rgba(109,216,151,0.3);
}
.btn-success:hover:not(:disabled) { background: rgba(109,216,151,0.25); }

.btn-danger {
  background: rgba(255,80,80,0.1);
  color: #ff9a9a;
  border: 1px solid rgba(255,80,80,0.25);
}
.btn-danger:hover:not(:disabled) { background: rgba(255,80,80,0.2); }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: #7a96b8;
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.09); color: #c0d0e4; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 11px; font-weight: 700;
  color: #7a96b8; text-transform: uppercase; letter-spacing: .5px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 14px; font-family: inherit;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.35);
  color: #e8edf5;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: rgba(147,187,252,0.45);
}
.form-group input[readonly] { color: #5a7a9a; cursor: default; }
.form-group select option    { background: #0f1b30; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Card de formulário ── */
.form-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.form-card-title {
  font-size: 14px; font-weight: 700; color: #93bbfc;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-transform: uppercase; letter-spacing: .5px;
}

/* ── Alert ── */
.alert {
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; display: none;
}
.alert.show { display: block; }
.alert-error   { background: rgba(255,80,80,0.1); border: 1px solid rgba(255,80,80,0.3); color: #ff9a9a; }
.alert-success { background: rgba(109,216,151,0.1); border: 1px solid rgba(109,216,151,0.25); color: #6dd897; }

/* ── Tabs ── */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 22px;
}
.tab-btn {
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  color: #5a7a9a; background: none; border: none;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-family: inherit;
  transition: color .15s;
}
.tab-btn:hover { color: #93bbfc; }
.tab-btn.active { color: #93bbfc; border-bottom-color: #93bbfc; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Table ── */
.table-wrap {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
}
table {
  width: 100%; border-collapse: collapse;
  background: rgba(255,255,255,0.02);
  font-size: 14px;
}
thead { background: rgba(0,0,0,0.2); }
th {
  padding: 11px 14px; text-align: left;
  font-size: 11px; font-weight: 700; color: #5a7a9a;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid rgba(255,255,255,0.08); white-space: nowrap;
}
td {
  padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #c0d0e4; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }

.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #0f1b30;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; gap: 16px;
  padding: 24px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-size: 15px; font-weight: 700; color: #c0d0e4; }
.modal-close  {
  background: none; border: none; cursor: pointer;
  color: #5a7a9a; font-size: 18px; line-height: 1;
  padding: 4px; transition: color .15s;
}
.modal-close:hover { color: #c0d0e4; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Toolbar ── */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.toolbar-title { font-size: 13px; font-weight: 600; color: #7a96b8; }

/* ── Misc ── */
.text-muted { color: #5a7a9a; }
.text-sm    { font-size: 12px; }

/* ── Login ── */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  text-align: center;
}
.login-box { width: 100%; max-width: 400px; }
.login-logo {
  display: flex; align-items: center; gap: 14px;
  justify-content: center; margin-bottom: 32px;
}
.login-logo img { height: 40px; width: auto; }
.login-logo-text h1 { font-size: 20px; font-weight: 700; color: #f0f4fa; }
.login-logo-text p  { font-size: 12px; color: #7a96b8; margin-top: 3px; }
.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px; padding: 32px 28px;
  text-align: left;
}
.login-card-title {
  font-size: 15px; font-weight: 700; color: #c0d0e4;
  margin-bottom: 22px; text-align: center;
}
.login-footer {
  text-align: center; margin-top: 20px;
  font-size: 11px; color: #3a5a7a;
}

/* ── Filter Pills ── */
.filter-pill {
  -webkit-appearance: none;
  appearance: none;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; font-family: inherit;
  background: #0d1a2e; color: #7a96b8;
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer; transition: background .15s, color .15s;
}
.filter-pill:hover { background: #122040; color: #c0d0e4; }
.filter-pill.active { background: rgba(147,187,252,0.15); color: #93bbfc; border-color: rgba(147,187,252,0.3); }

/* ── Select global (dropdown list) ── */
select option { background: #0f1b30; color: #e8edf5; }

/* ── Date picker icon ── */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  opacity: 0.8;
  cursor: pointer;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .modules-grid { grid-template-columns: 1fr; }
  .main { padding: 20px 14px 60px; }
}
