/* ====== Basic Reset & Fonts ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif; background: #f6f8fb; color: #222; }

/* ====== Layout ====== */
.container {
  max-width: 1100px;
  margin: 28px auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(12,20,40,0.06);
  border: 1px solid rgba(18,38,63,0.04);
}

/* Header / Top Bar */
.topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.brand {
  display:flex;
  align-items:center;
  gap:12px;
}
.brand .logo {
  width:44px; height:44px; border-radius:10px;
  background: linear-gradient(135deg,#0ea5a4,#6366f1);
  display:inline-flex; align-items:center; justify-content:center; color:#fff; font-weight:700;
  box-shadow: 0 6px 18px rgba(61,72,88,0.08);
}
.brand h1 { font-size:18px; letter-spacing:0.2px; color:#0f172a; }
.top-actions { display:flex; gap:10px; align-items:center; }

/* Links */
.top-actions a {
  text-decoration:none; padding:8px 12px; border-radius:8px; font-size:14px;
  background:transparent; color:#334155; border:1px solid transparent;
}
.top-actions a.btn {
  background: linear-gradient(90deg,#06b6d4,#7c3aed);
  color:#fff; box-shadow:0 8px 20px rgba(99,102,241,0.12); border: none;
}

/* ====== Forms ====== */
.form-row { display:flex; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.form-row .field { flex:1 1 240px; }
label { display:block; font-size:13px; color:#475569; margin-bottom:6px; }
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
  width:100%;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #e6eef8;
  background:#fbfdff;
  font-size:14px;
  color:#0f172a;
  transition: box-shadow .15s, border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline:none;
  border-color:#7c3aed;
  box-shadow:0 6px 18px rgba(124,58,237,0.08);
}

/* Buttons */
.btn-primary {
  display:inline-block; padding:10px 14px; border-radius:10px; font-weight:600;
  background: linear-gradient(90deg,#06b6d4,#7c3aed);
  color:#fff; border:none; cursor:pointer;
  box-shadow: 0 10px 26px rgba(99,102,241,0.10);
  text-decoration: unset;
}
.btn-ghost {
  background:transparent; border:1px solid #e6eef8; color:#0f172a; padding:8px 12px;
  border-radius:8px; cursor:pointer;
}

/* ====== Table ====== */
.table-wrap { overflow-x:auto; margin-top:16px; }
table {
  width:100%; border-collapse:collapse; min-width:640px;
  font-size:14px;
}
thead th {
  background: linear-gradient(180deg,#fbfdff,#f8fafc);
  text-align:left; padding:12px 14px; color:#0f172a; font-weight:700;
  border-bottom:1px solid #eef2ff;
}
tbody td {
  padding:12px 14px; border-bottom:1px dashed rgba(15,23,42,0.04);
  color:#273444;
}
tr:hover td { background: linear-gradient(90deg, rgba(124,58,237,0.03), transparent); }

/* Badge / Type */
.badge {
  display:inline-block; padding:6px 8px; border-radius:999px; font-size:12px; font-weight:600;
  background:#eef2ff; color:#3730a3;
}
.badge.credit { background:#ecfdf5; color:#065f46; }
.badge.debit { background:#fff7ed; color:#92400e; }

/* ====== Empty / Messages ====== */
.empty {
  text-align:center; padding:28px; color:#6b7280; background:#fbfdff; border-radius:8px; margin-top:12px;
  border:1px dashed #e6eef8;
}

/* ====== Responsive ====== */
@media (max-width:760px) {
  .container { margin:14px; padding:14px; border-radius:10px; }
 
  .brand h1 { font-size:16px; }
  thead th { font-size:13px; }
  tbody td { font-size:13px; padding:10px; }
}

/* ====== Small Utilities ====== */
.mt-8 { margin-top:8px; }
.mt-16 { margin-top:16px; }
.mb-8 { margin-bottom:8px; }

/* ====== History specific ====== */
.history-controls { display:flex; gap:12px; align-items:center; margin-bottom:12px; flex-wrap:wrap; }
.card {
  background:#fff; padding:14px; border-radius:12px; border:1px solid rgba(13,24,45,0.03);
  box-shadow:0 6px 18px rgba(12,20,40,0.03);
}

/* Nice small footer */
.footer {
  text-align:center; color:#94a3b8; font-size:13px; margin-top:18px;
  padding: 50px 0px;
}
.form-box {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.form-box label {
    font-weight: bold;
    margin-top: 10px;
    display: block;
}
.form-box .form-control {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}
.form-box .btn {
    padding: 10px 15px;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}
.form-box .btn:hover {
    background: #0056b3;
}

.result {
    border: 1px solid #ccc;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    background: #fff;
    position: absolute;
    z-index: 1000;
    width: calc(100% - 20px);
}
.result p {
    margin: 0;
    padding: 8px;
    cursor: pointer;
}
.result p:hover {
    background: #f1f1f1;
}
.select2-container .select2-selection--single {
    height: 38px;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 4px 8px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
}

.select2-dropdown {
    border-radius: 6px;
}

/* General Layout */
.container, .card, .form, .table-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 10px;
}

/* Form fields */
.form input, 
.form textarea, 
.form select {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

/* Buttons */
button, .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 8px;
    text-align: left;
}
.table-wrapper {
    overflow-x: auto;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    .header, .footer {
        flex-direction: column;
        text-align: center;
    }

    .sidebar {
        display: none; /* Mobile pe sidebar hide */
    }

    .card {
        margin: 10px 0;
        padding: 15px;
    }
}
/* ==== HEADER & TOPBAR ==== */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 15px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .logo {
  background: #3b82f6;
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand h1 {
  font-size: 20px;
  margin: 0;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.top-actions a {
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: 0.2s;
      width: max-content;
}

.btn {
  background: #3b82f6;
  color: #fff;
}

.btn-ghost {
  border: 1px solid #3b82f6;
  color: #3b82f6;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .brand {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .brand h1 {
    font-size: 18px;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .top-actions a {
    flex: 1 1 45%;
    text-align: center;
    margin: 5px 0;
  }
}

@media (max-width: 480px) {
  .top-actions a {
    flex: 1 1 100%;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand .logo {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
}

/* mobile menu toggle hidden on desktop */
.menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
  user-select: none;
}

/* responsive nav */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .top-actions {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #f9fafb;
    padding: 10px;
    border-radius: 8px;
  }

  .top-actions a {
    margin: 5px 0;
    text-align: center;
    flex: none;
  }

  .top-actions.active {
    display: flex;
  }
}

/* ====== FORM RESPONSIVE ====== */
.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.field {
  flex: 1;
  min-width: 200px;
}

/* Mobile View */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .field {
    width: 100%;
    flex: unset !important;
  }

  input, select, textarea {
    width: 100%;
    font-size: 16px;
  }

  .btn-primary, .btn {
    width: 100%;
    text-align: center;
    padding: 10px;
    text-decoration: unset;
        border-radius: 10px;
  }
  .table-wrap {
    max-height: 300px;
}
}
td[data-label="Actions"] {
    text-align: center !important;
}
tbody#customerData a {
    width: 50% !important;
    text-align: center;
    padding: 10px 4px;
    text-decoration: unset;
    border-radius: 10px;
}
a.btn.btn-sm.btn-danger {
    background-color: #dc0000;
    padding: 10px 24px !important;
}
.select2-container--default .select2-selection--single {
    width: 100%;
    border-radius: 8px !important;
    border: 1px solid #e6eef8 !important;
    background: #fbfdff;
    font-size: 14px;
    color: #0f172a;
    transition: box-shadow .15s, border-color .15s;
    min-height: 38px;
}
a.btn.btn-secondary {
    height: 43px;
    text-align: center;
    text-decoration: unset;
    border-radius: 10px;
    margin-top: 10px;
    align-items: center;
    display: flex;
    justify-content: center;
    font-weight: 600;
    background: linear-gradient(90deg, #06b6d4, #7c3aed);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.12);
    border: none;
}
/* ====== TABLE RESPONSIVE ====== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* prevent table collapse */
}

.table-wrap th,
.table-wrap td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

/* Mobile Table Style */
@media (max-width: 600px) {
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap th,
  .table-wrap td,
  .table-wrap tr,
  .table{
    display: block;
    min-width: unset;
  }

  .table-wrap thead {
    display: none; /* hide header */
  }

  .table-wrap tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
  }

  .table-wrap td {
    border: none;
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    gap: 10px;
  }

  .table-wrap td::before {
    content: attr(data-label);
    font-weight: bold;
    flex: 1;
    padding-right: 10px;
    color: #444;
  }
}





