* {
  box-sizing: border-box;
}

:root {
  --bg: #0b0e14;
  --sidebar: #10141c;
  --panel: #171c26;
  --panel2: #1c222e;
  --border: #293140;
  --text: #f4f6fa;
  --muted: #8f99aa;
  --red: #ef334e;
  --green: #65dfa0;
  --blue: #70a7ff;
  --orange: #f0aa4f;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    Arial,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: flex;
}


/* SIDEBAR */

.sidebar {
  width: 235px;
  min-width: 235px;
  min-height: 100vh;

  position: fixed;
  left: 0;
  top: 0;

  background: var(--sidebar);
  border-right: 1px solid var(--border);

  padding: 22px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 0 8px 24px;
}

.brand-icon {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 11px;

  background: var(--red);

  font-size: 20px;
  font-weight: 900;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav-section {
  color: #626c7d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;

  margin:
    20px
    10px
    8px;
}

.nav-item {
  display: block;
  width: 100%;

  padding: 11px 12px;

  margin-bottom: 3px;

  text-align: left;

  border: 0;
  border-radius: 8px;

  color: #aeb6c4;
  background: transparent;

  font-weight: 600;
}

.nav-item:hover {
  background: #191f2a;
  color: white;
}

.nav-item.active {
  background: #252c3a;
  color: white;
}

.nav-item.disabled {
  opacity: .35;
  cursor: default;
}


/* MAIN */

.main {
  width: calc(100% - 235px);

  margin-left: 235px;

  padding: 30px 34px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 25px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 27px;
}

.subtitle,
.muted {
  color: var(--muted);
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;

  color: #a9b2c0;
  font-size: 13px;

  background: #141922;
  border: 1px solid var(--border);

  padding: 8px 12px;
  border-radius: 30px;
}

.status-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: var(--green);

  box-shadow:
    0 0 10px
    rgba(101,223,160,.7);
}


/* PAGES */

.page {
  display: none;
}

.page.active {
  display: block;
}


/* CARDS */

.cards {
  display: grid;
  grid-template-columns:
    repeat(6, minmax(130px, 1fr));

  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);

  border-radius: 13px;

  padding: 18px;
}

.card-label {
  color: var(--muted);

  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.card-value {
  margin-top: 8px;

  font-size: 27px;
  font-weight: 800;
}

.green {
  color: var(--green);
}

.blue {
  color: var(--blue);
}


/* PANELS */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);

  border-radius: 13px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 18px;
}

.panel-header h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 14px;

  margin-top: 16px;
}

.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 12px;

  padding: 0 18px 18px;
}

.balance-box {
  background: #11161e;

  border: 1px solid #262e3c;
  border-radius: 10px;

  padding: 17px;
}

.balance-box span {
  display: block;

  color: var(--muted);
  font-size: 12px;

  margin-bottom: 8px;
}

.balance-box strong {
  font-size: 22px;
}

.inventory-list {
  padding:
    0
    18px
    18px;
}

.inventory-list > div {
  display: flex;
  justify-content: space-between;

  padding: 11px 0;

  border-bottom:
    1px solid
    #272e3a;
}

.inventory-list > div:last-child {
  border-bottom: 0;
}


/* ACTIONS */

.page-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 15px;

  margin-bottom: 16px;
}

.filters-inline {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
}


/* INPUTS */

input,
select,
textarea {
  color: white;

  background: #10151d;

  border:
    1px solid
    #303949;

  border-radius: 8px;

  padding: 10px 11px;

  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #59657a;
}

select option {
  background: #161b24;
  color: white;
}

.search {
  min-width: 290px;
}


/* BUTTONS */

button {
  color: white;
  background: var(--red);

  border: 0;
  border-radius: 8px;

  padding: 10px 14px;

  font-weight: 700;
}

button:hover {
  opacity: .9;
}

button.secondary {
  background: #293140;
}

button.danger {
  background: #8e2635;
}

button.small {
  padding: 7px 10px;
  font-size: 12px;
}


/* TABLE */

.table-panel {
  overflow-x: auto;
}

table {
  width: 100%;

  border-collapse: collapse;
}

.wide-table {
  min-width: 1050px;
}

th {
  color: #8f99aa;
  background: #131821;

  padding: 13px 14px;

  text-align: left;

  font-size: 10px;
  letter-spacing: .6px;
  text-transform: uppercase;

  white-space: nowrap;
}

td {
  padding: 13px 14px;

  border-top:
    1px solid
    #28303d;

  font-size: 13px;

  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(255,255,255,.015);
}

.phone-number {
  font-family:
    Consolas,
    monospace;

  font-weight: 700;
}

.money {
  font-weight: 800;
}


/* STATUS */

.badge {
  display: inline-block;

  padding: 5px 8px;

  border-radius: 20px;

  font-size: 11px;
  font-weight: 700;

  text-transform: capitalize;
}

.badge.available {
  color: #7be4aa;
  background: rgba(101,223,160,.12);
}

.badge.assigned {
  color: #8eb8ff;
  background: rgba(112,167,255,.12);
}

.badge.suspended {
  color: #f1b96f;
  background: rgba(240,170,79,.12);
}

.badge.released {
  color: #9ca5b4;
  background: rgba(156,165,180,.12);
}

.badge.active {
  color: #7be4aa;
  background: rgba(101,223,160,.12);
}

.badge.inactive {
  color: #a6afbd;
  background: rgba(166,175,189,.1);
}


/* PRICING */

.pricing-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(280px, 1fr)
    );

  gap: 14px;
}

.pricing-card {
  background: var(--panel);

  border:
    1px solid
    var(--border);

  border-radius: 13px;

  padding: 19px;
}

.pricing-card h3 {
  margin: 0 0 5px;
}

.pricing-country {
  color: var(--muted);
  font-size: 12px;

  margin-bottom: 18px;
}

.price-row {
  display: flex;
  justify-content: space-between;

  padding: 9px 0;

  border-bottom:
    1px solid
    #29303c;
}

.price-row:last-child {
  border-bottom: 0;
}


/* TWILIO */

.account-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(300px, 1fr)
    );

  gap: 14px;
}

.account-card {
  background: var(--panel);

  border:
    1px solid
    var(--border);

  border-radius: 13px;

  padding: 19px;
}

.account-card h3 {
  margin: 0 0 5px;
}

.account-sid {
  color: var(--muted);

  font-family:
    Consolas,
    monospace;

  font-size: 11px;

  word-break: break-all;

  margin-bottom: 18px;
}

.account-stat {
  display: flex;
  justify-content: space-between;

  padding-top: 12px;

  border-top:
    1px solid
    #29303c;
}


/* DIALOGS */

dialog {
  width:
    min(
      570px,
      95vw
    );

  color: white;
  background: #171c26;

  border:
    1px solid
    #384254;

  border-radius: 14px;

  padding: 24px;
}

dialog::backdrop {
  background:
    rgba(0,0,0,.72);
}

dialog h2 {
  margin:
    0
    0
    18px;
}

.dialog-number {
  color: var(--muted);

  font-family:
    Consolas,
    monospace;

  margin:
    -10px
    0
    18px;
}

.form-grid {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 13px;
}

.form-grid label {
  display: block;

  color: #a1aaba;

  font-size: 12px;

  margin-bottom: 6px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
}

.full {
  grid-column:
    1 / -1;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;

  gap: 9px;

  margin-top: 22px;
}


/* TOAST */

.toast {
  position: fixed;

  right: 25px;
  bottom: 25px;

  min-width: 230px;

  color: white;
  background: #202734;

  border:
    1px solid
    #394355;

  border-radius: 10px;

  padding: 13px 16px;

  box-shadow:
    0 10px 35px
    rgba(0,0,0,.35);

  opacity: 0;
  pointer-events: none;

  transform:
    translateY(10px);

  transition: .2s;

  z-index: 9999;
}

.toast.show {
  opacity: 1;

  transform:
    translateY(0);
}

.toast.error {
  border-color: #8e3543;
}


/* EMPTY */

.empty-state {
  padding: 35px;

  color: var(--muted);

  text-align: center;
}


/* RESPONSIVE */

@media(max-width: 1200px) {

  .cards {
    grid-template-columns:
      repeat(3, 1fr);
  }

}


@media(max-width: 850px) {

  .sidebar {
    width: 190px;
    min-width: 190px;
  }

  .main {
    margin-left: 190px;
    width: calc(100% - 190px);

    padding: 22px;
  }

  .cards {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .page-actions {
    align-items: flex-start;
    flex-direction: column;
  }

}


@media(max-width: 650px) {

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    width: 100%;

    padding: 16px;
  }

  .cards {
    grid-template-columns:
      1fr 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: auto;
  }

}
[hidden] { display: none !important; }
.text-link { background: none; padding: 0; color: var(--blue); text-align: left; }
.sidebar { height:100vh; overflow-y:auto; }
.text-link:hover { text-decoration: underline; }
.button-link { background: var(--red); color: white; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.balance-line { display:flex; align-items:center; gap:12px; padding:14px; margin-bottom:8px; border:1px solid var(--border); border-radius:8px; }
.balance-line span { flex:1; }
.alert-card { background:var(--panel); border:1px solid var(--border); border-left:4px solid var(--orange); padding:14px; margin:10px 0; border-radius:8px; }
.alert-card.critical { border-left-color:var(--red); }
.alert-card.resolved { opacity:.6; border-left-color:var(--green); }
.auth-gate { min-height:100vh; display:flex; justify-content:center; align-items:center; padding:20px; }
.auth-form { width:min(420px,100%); padding:28px; }
.auth-form label,.auth-form input { display:block; width:100%; margin-top:12px; }
#authError { color:var(--red); }
#page-calls > .filters-inline { margin-bottom:12px; }
@media(max-width:650px) { .sidebar { display:block !important; position:relative; width:100%; min-height:0; height:auto; } .sidebar nav { display:flex; flex-wrap:wrap; gap:5px; } .sidebar .nav-section { display:none; } .sidebar .nav-item { width:auto; } .app { flex-direction:column; } .main { margin-left:0; width:100%; } .balance-line { flex-wrap:wrap; } }
.sync-details { white-space: pre-line; color: var(--muted); font-size: 12px; margin: 14px 0; overflow-wrap: anywhere; }
#page-calls .filters-inline { align-items: end; }
#page-calls label { font-size: 12px; color: var(--muted); }
#page-calls label input { display: block; margin-top: 6px; }
#page-twilio .page-actions button { margin-left: 8px; }
