* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background: #eef1f5;
  color: #111827;
}

/* ===== Topbar ===== */

.topbar {
  min-height: 82px;
  padding: 14px 18px;
  background: #ffad9d;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid #d48776;
}

.topbar h1 {
  margin: 0;
  font-size: 23px;
  color: #111827;
}

.topbar p {
  margin: 5px 0 0;
  font-size: 13px;
  color: #111827;
  font-weight: bold;
}

.token-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.token-box input {
  width: 260px;
  height: 38px;
}

/* ===== Layout ===== */

.layout {
  display: flex;
  min-height: calc(100vh - 82px);
}

.sidebar {
  width: 220px;
  background: #ffffff;
  border-right: 1px solid #cfd6df;
  padding: 12px;
}

/* ===== Sidebar Buttons ===== */

.nav-btn {
  width: 100%;
  display: block;
  padding: 13px 14px;
  margin-bottom: 9px;
  border: 1px solid #b8c0cc;
  background: #ffffff;
  color: #111827 !important;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: bold;
  border-radius: 6px;
}

.nav-btn:hover {
  background: #e8f3ff;
  border-color: #0b83d8;
}

.nav-btn.active {
  background: #0b83d8;
  color: #ffffff !important;
  border-color: #0b83d8;
}

/* ===== Main Content ===== */

.content {
  flex: 1;
  padding: 18px;
}

.card {
  background: #ffffff;
  border: 1px solid #d4dae3;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 8px;
}

.card h2 {
  margin-top: 0;
  color: #111827;
}

/* ===== Form ===== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #111827;
  margin-bottom: 4px;
}

input,
textarea,
select {
  width: 100%;
  padding: 9px;
  border: 1px solid #aeb7c3;
  border-radius: 4px;
  font-size: 14px;
  background: #ffffff;
  color: #111827;
}

input::placeholder,
textarea::placeholder {
  color: #7b8491;
}

textarea {
  min-height: 70px;
}

/* ===== Buttons ===== */

button {
  padding: 9px 14px;
  border: none;
  background: #0b83d8;
  color: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  opacity: 0.9;
}

button.secondary {
  background: #666f7a;
}

button.danger {
  background: #b42318;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* ===== Message ===== */

.message {
  margin-top: 10px;
  font-weight: bold;
}

.message.ok {
  color: #087f23;
}

.message.error {
  color: #c00000;
}

/* ===== Table ===== */

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  border: 1px solid #c6ccd5;
  padding: 8px;
  font-size: 14px;
  vertical-align: top;
  color: #111827;
}

th {
  background: #e7e9ed;
  font-weight: bold;
}

tr:nth-child(even) td {
  background: #fafafa;
}

.amount {
  text-align: right;
}

/* ===== Dashboard ===== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.summary-box {
  background: #f7f9fc;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 16px;
}

.summary-box.revenue {
  background: #eefaf0;
  border-color: #b7dfbd;
}

.summary-title {
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
  font-weight: bold;
}

.summary-value {
  font-size: 26px;
  font-weight: bold;
  color: #111827;
}

/* ===== Mobile ===== */

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .nav-btn {
    margin-bottom: 0;
    text-align: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .token-box {
    flex-wrap: wrap;
  }

  .token-box input {
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.small-btn {
  padding: 6px 10px;
  font-size: 13px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.muted-text {
  color: #6b7280;
  margin: 4px 0 0;
  font-size: 13px;
}

.dashboard-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h2 {
  margin: 0;
}

.info-list {
  display: grid;
  gap: 10px;
  line-height: 1.6;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #eef2ff;
  color: #1f3a8a;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
}

@media (max-width: 900px) {
  .dashboard-header {
    flex-direction: column;
  }

  .dashboard-actions {
    justify-content: flex-start;
  }

  .dashboard-two-columns {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.form-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.form-toolbar h2 {
  margin: 0;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.document-form {
  display: grid;
  gap: 16px;
}

.document-section {
  border: 1px solid #d4dae3;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.document-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.span-3 {
  grid-column: span 3;
}

.table-scroll {
  overflow-x: auto;
}

.items-table {
  min-width: 1200px;
}

.items-table input {
  min-width: 80px;
}

.document-bottom {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}

.document-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 14px;
}

.summary-panel {
  background: #ffffff;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  padding: 14px;
}

.summary-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.summary-row input {
  text-align: right;
  font-weight: bold;
}

.checkbox-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.checkbox-line input {
  width: auto;
}

@media (max-width: 900px) {
  .form-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .document-bottom {
    grid-template-columns: 1fr;
  }

  .span-3 {
    grid-column: span 1;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }
}