@import url(https://fonts.googleapis.com/earlyaccess/droidarabickufi.css);

body {
  font-family: 'Droid Arabic Kufi', Tahoma, sans-serif;
  line-height: 1.9;
  padding-top: 70px; /* room for the fixed navbar */
}

/* Login / change-password box */
.login-box {
  direction: rtl;
  text-align: right;
  width: 90%;
  max-width: 420px;
  margin-top: 6%;
}
.login-box label { display: block; margin-top: 10px; }
.login-box .btn-search3 {
  background: #337ab7;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 8px 28px;
  cursor: pointer;
}

/* Statement page */
.statement {
  direction: rtl;
  text-align: right;
  width: 90%;
}
.statement-filter .input-group { display: block; margin-bottom: 10px; }
.statement-filter label.type-tab { min-width: 0; margin-left: 0; }
.statement-filter label { display: inline-block; min-width: 70px; margin-left: 8px; }
.statement-total {
  margin: 20px 0 30px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
}
.statement .table { direction: ltr; }
/* Headers and values share one alignment: numbers/dates centred, notes right-aligned */
.statement .table > thead > tr > th,
.statement .table > tbody > tr > td { text-align: center; vertical-align: middle; }
.statement .table > thead > tr > th:nth-child(5),
.statement .table > tbody > tr > td:nth-child(5) { direction: rtl; text-align: right; unicode-bidi: plaintext; }
.statement .table > tbody > tr.row-opening > td.cell-title { text-align: right; }
.statement .row-payment { background-color: #ccffff !important; }
.statement .row-return  { background-color: #ffcc66 !important; }
.statement .row-opening { background-color: #eee; font-weight: bold; }

/* Summary cards */
.summary-cards { display: flex; gap: 12px; margin: 10px 0 24px; }
.summary-card {
  flex: 1;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-top: 4px solid #999;
  border-radius: 6px;
  text-align: center;
}
.summary-card.owed   { border-top-color: #d9534f; }
.summary-card.credit { border-top-color: #5cb85c; }
.summary-card.clear  { border-top-color: #5cb85c; }
.summary-label { font-size: 14px; color: #555; }
.summary-value { font-size: 28px; font-weight: bold; line-height: 1.5; direction: ltr; }
.summary-card.owed .summary-value { color: #c9302c; }
.summary-sub   { font-size: 13px; color: #888; }

/* Quick ranges, type tabs, search */
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.quick-ranges { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.statement-filter input[type=text] { width: 100%; max-width: 260px; }
.type-tabs { margin: 6px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.type-tab {
  margin: 0;
  padding: 5px 14px;
  border: 1px solid #ccc;
  border-radius: 16px;
  cursor: pointer;
  font-weight: normal;
  background: #fff;
}
.type-tab input { position: absolute; opacity: 0; pointer-events: none; }
.type-tab.active { background: #337ab7; border-color: #337ab7; color: #fff; }
.type-tab:focus-within { outline: 2px solid #66afe9; }
.search-btn { margin-right: auto; }
.result-count { margin: 6px 0 10px; font-size: 13px; }
.statement .row-empty td { text-align: center !important; padding: 20px; color: #888; }

/* Phones: show each movement as a card instead of a wide scrolling table */
@media (max-width: 767px) {
  body { padding-top: 60px; }
  .login-box { margin-top: 24px; }
  .statement { width: 100%; padding: 0 15px; }
  .statement .page-header { font-size: 26px; margin-top: 10px; }
  .statement-filter label { display: block; margin-bottom: 4px; }
  .statement-filter label.type-tab { display: inline-block; margin-bottom: 0; }
  .statement-filter input[type=text] { width: 100%; padding: 8px; }
  .statement-filter input[type=submit] { width: 100%; padding: 10px; }
  .statement-total { font-size: 18px; }
  .summary-cards { flex-wrap: wrap; gap: 8px; }
  .summary-card { flex: 1 1 45%; padding: 10px; }
  .summary-card:first-child { flex-basis: 100%; }
  .summary-value { font-size: 24px; }
  .statement-filter input[type=text] { max-width: none; }
  .quick-ranges .btn { flex: 1 1 30%; }
  .search-btn { flex: 1 1 100%; margin: 6px 0 0; padding: 10px; }
  .statement-filter .row { margin: 0; }
  .statement-filter .row > .col-lg-4 { padding: 0; }
  .statement-filter .row > .col-lg-4:nth-child(-n+2) { float: right; width: 48%; }
  .statement-filter .row > .col-lg-4:nth-child(2) { margin-right: 4%; }
  .statement-filter .row > .col-lg-4:nth-child(3) { clear: both; }
  .statement-filter input[type=text] { padding: 8px 6px; font-size: 14px; }
  .statement-filter .input-group { margin-bottom: 6px; }

  .statement .table-responsive { border: 0; overflow: visible; margin-bottom: 0; }
  .statement .table,
  .statement .table tbody { display: block; width: 100%; direction: rtl; }
  .statement .table thead { display: none; }
  .statement .table tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
  }
  .statement .table > tbody > tr > td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border: 0;
    padding: 4px 0;
    text-align: right;
  }
  .statement .table td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #555;
    margin-left: 12px;
    flex: none;
  }
  .statement .table td:nth-child(4) { order: -2; }
  .statement .table td:nth-child(5) { order: -1; word-break: break-word; unicode-bidi: plaintext; }
  .statement .table td:nth-child(5)::before { display: none; }
  .statement .table td.na { display: none; }
  .statement .table td.cell-title::before { display: none; }
  .statement .table td.cell-title h4 { margin: 4px 0; }
}
