/* ============================================================
   Minimal + Responsive Override for Bootstrap 3.3.7
   Designed for tablets & phones. No backend changes.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* ---------- Reset / Base ---------- */
html {
  font-size: 15px;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f5f7;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
}
a { transition: color .15s; }

/* ---------- Headers ---------- */
header {
  margin-top: 0;
  background: url(../img/CINTILLO-WEB.jpg) no-repeat center center;
  background-size: 100% 100%;
  height: 100px;
  width: 100%;
  display: block;
}
header2 {
  background: url(../img/cintillo_invalteca.png) no-repeat center;
  width: 100%;
  height: 180px;
  background-size: 100% 100%;
  display: block;
}
header3 {
  margin-top: 0;
  background: url(../img/pie.jpg) no-repeat center center;
  background-size: 100% 100%;
  height: 250px;
  width: 100%;
  display: block;
}

@media (min-width: 1200px) {
  header2 { height: 220px; }
}
@media (max-width: 768px) {
  header  { height: 60px; }
  header2 { height: 100px; }
  header3 { height: 120px; }
}

/* ---------- Navbar ---------- */
.navbar {
  border: none !important;
  border-radius: 0 !important;
  margin-bottom: 0;
  min-height: 52px;
}
.navbar-default {
  background: #0f0c29;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.navbar-default .navbar-nav > li > a {
  color: #ccc !important;
  font-size: 13px;
  font-weight: 500;
  padding: 15px 14px;
  letter-spacing: .02em;
  transition: color .15s, background .15s;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: #fff !important;
  background: rgba(255,255,255,.07) !important;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
}
.navbar-default .navbar-toggle {
  border: 1px solid rgba(255,255,255,.3);
  margin-top: 9px;
  margin-bottom: 9px;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
  background: rgba(255,255,255,.1);
}
.navbar-default .navbar-toggle .icon-bar {
  background: #fff;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
  border-color: rgba(255,255,255,.08);
}
.dropdown-menu {
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  margin-top: 4px;
  padding: 6px 0;
}
.dropdown-menu > li > a {
  padding: 8px 20px;
  font-size: 13px;
  color: #444;
  transition: background .12s;
}
.dropdown-menu > li > a:hover {
  background: #f0f2f5;
}
.navbar-nav > li > .dropdown-menu {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Mobile navbar */
@media (max-width: 767px) {
  .navbar-default .navbar-nav > li > a {
    padding: 10px 16px;
    font-size: 14px;
  }
  .navbar-default .navbar-nav .open .dropdown-menu > li > a {
    color: #ccc !important;
    padding: 8px 20px;
  }
  .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover {
    color: #fff !important;
    background: rgba(255,255,255,.06);
  }
  .navbar-nav {
    margin: 0;
  }
  .navbar-nav .open .dropdown-menu {
    background: rgba(0,0,0,.15);
    border-radius: 0;
    box-shadow: none;
  }
}

/* ---------- Panels → Cards ---------- */
.panel {
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  margin-bottom: 24px;
  background: #fff;
}
.panel-info {
  border: none !important;
}
.panel-info > .panel-heading {
  background: #fff !important;
  color: #1a1a2e !important;
  border-bottom: 1px solid #eef0f2 !important;
  border-radius: 12px 12px 0 0;
  padding: 16px 20px;
  font-weight: 600;
}
.panel-info > .panel-heading h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
}
.panel-body {
  padding: 20px;
  background: #fff;
  border-radius: 0 0 12px 12px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #1a1a2e;
}

/* ---------- Forms ---------- */
.form-control {
  border-radius: 8px;
  border: 1.5px solid #dfe3e8;
  padding: 10px 14px;
  height: auto;
  font-size: 14px;
  box-shadow: none !important;
  transition: border-color .18s, box-shadow .18s;
}
.form-control:focus {
  border-color: #4a6cf7;
  box-shadow: 0 0 0 3px rgba(74,108,247,.12) !important;
}
.form-group {
  margin-bottom: 16px;
}
.control-label {
  font-weight: 500;
  color: #555;
  font-size: 13px;
  margin-bottom: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 18px;
  transition: all .15s;
  border: none;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.btn:active {
  transform: translateY(0);
}
.btn-info {
  background: #4a6cf7;
  color: #fff;
}
.btn-info:hover {
  background: #3b5de7;
  color: #fff;
}
.btn-danger {
  background: #e74c3c;
}
.btn-danger:hover {
  background: #c0392b;
}
.btn-success {
  background: #2ecc71;
}
.btn-success:hover {
  background: #27ae60;
}
.btn-warning {
  background: #f39c12;
}
.btn-warning:hover {
  background: #e67e22;
}
.btn-default {
  background: #f0f2f5;
  color: #333;
  border: 1px solid #dfe3e8;
}
.btn-default:hover {
  background: #e2e5ea;
}
.btn-primary {
  background: #1a1a2e;
}
.btn-primary:hover {
  background: #2d2d4a;
}
.btn-group .btn {
  margin-right: 4px;
}
.btn-group .btn:last-child {
  margin-right: 0;
}

/* ---------- Labels & Badges ---------- */
.label {
  font-weight: 500;
  font-size: 11px;
  border-radius: 6px;
  padding: 3px 8px;
}
.label-success { background: #2ecc71; }
.label-danger  { background: #e74c3c; }
.label-warning { background: #f39c12; }
.label-info    { background: #4a6cf7; }

/* ---------- Tables ---------- */
/* Always scroll horizontally on small screens */
.table-responsive {
  border: none !important;
  margin-bottom: 0;
}
.table {
  margin-bottom: 0;
  font-size: 13px;
}
.table > thead > tr > th {
  border-bottom: 2px solid #eef0f2;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #666;
  padding: 10px 10px;
  white-space: nowrap;
}
.table > tbody > tr > td {
  padding: 10px;
  vertical-align: middle;
  border-top: 1px solid #f0f2f5;
}
.table > tbody > tr:hover {
  background: #f8f9fd;
}
.table-bordered {
  border: 1px solid #eef0f2;
}
.table-bordered > thead > tr > th {
  border: 1px solid #eef0f2;
}
.table-bordered > tbody > tr > td {
  border: 1px solid #f0f2f5;
}

/* ---- Tables: columns shrink to fit, no horizontal scroll ---- */
@media (max-width: 767px) {
  .table-responsive {
    border: none;
    margin-bottom: 0;
    overflow-x: visible;
  }
  .table > thead > tr > th,
  .table > tbody > tr > td {
    white-space: normal;
    word-break: break-word;
    padding: 5px 4px;
    font-size: 11px;
  }
  .table > tbody > tr > td {
    word-break: break-all;
    overflow-wrap: break-word;
  }
}

/* ---------- Modals ---------- */
.modal-content {
  border-radius: 14px;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
}
.modal-header {
  border-bottom: 1px solid #eef0f2;
  border-radius: 14px 14px 0 0;
  padding: 18px 24px;
}
.modal-header h4 {
  font-weight: 600;
  font-size: 17px;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  border-top: 1px solid #eef0f2;
  border-radius: 0 0 14px 14px;
  padding: 14px 24px;
}
.modal-backdrop.in {
  opacity: .4;
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: 10px;
  border: none;
  font-size: 13px;
  padding: 12px 16px;
}
.alert-danger {
  background: #fef0ef;
  color: #c0392b;
}
.alert-success {
  background: #eafaf1;
  color: #27ae60;
}
.alert-warning {
  background: #fef9e7;
  color: #e67e22;
}
.alert-info {
  background: #eef1fe;
  color: #4a6cf7;
}

/* ---------- Pagination ---------- */
.pagination {
  margin: 16px 0 0;
}
.pagination > li > a,
.pagination > li > span {
  border-radius: 8px !important;
  margin: 0 2px;
  padding: 6px 13px;
  font-size: 13px;
  color: #4a6cf7;
  border: 1px solid #e8eaed;
  transition: all .12s;
}
.pagination > li > a:hover {
  background: #4a6cf7;
  color: #fff;
  border-color: #4a6cf7;
}
.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > span {
  background: #1a1a2e !important;
  border-color: #1a1a2e !important;
  color: #fff !important;
}

/* ---------- Tabs ---------- */
.nav-tabs {
  border-bottom: 1px solid #eef0f2;
}
.nav-tabs > li > a {
  border: none !important;
  color: #888;
  font-weight: 500;
  font-size: 13px;
  padding: 10px 18px;
  margin-right: 2px;
  border-radius: 8px 8px 0 0;
}
.nav-tabs > li > a:hover {
  background: #f4f5f7;
  color: #333;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  border: none !important;
  border-bottom: 2px solid #4a6cf7 !important;
  color: #1a1a2e;
  font-weight: 600;
  background: transparent;
}

/* ---------- Misc ---------- */
.well {
  border-radius: 10px;
  border: none;
  background: #f8f9fd;
  box-shadow: none;
}
.progress {
  border-radius: 8px;
  height: 8px;
}
.thumbnail {
  border-radius: 10px;
  border: 1px solid #eef0f2;
}
.list-group-item {
  border: 1px solid #eef0f2;
  border-radius: 8px !important;
  margin-bottom: 4px;
}
.page-header {
  border-bottom: 1px solid #eef0f2;
}

/* ---------- Scrollable containers (common in this project) ---------- */
div[style*="overflow"] {
  border-radius: 8px;
}

/* ---------- Reportes sidebar ---------- */
#gw-sidebar {
  border-radius: 10px;
  border: 1px solid #e8eaed;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  background: #fff;
}
.gw-nav-list > li > a {
  padding: 12px 16px;
  font-weight: 500;
  color: #333;
  border-bottom: 1px solid #f0f2f5;
  transition: background .12s;
}
.gw-nav-list > li > a:hover {
  background: #f4f5f7;
}
.gw-submenu li a {
  padding: 10px 30px;
  color: #666;
  font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
  transition: all .12s;
}
.gw-submenu li a:hover {
  background: #f8f9fd;
  color: #4a6cf7;
  padding-left: 35px;
}
#contenido {
  border-radius: 10px;
  border: 1px solid #e8eaed;
  background: #fff;
  padding: 20px;
  min-height: 400px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ---------- Login override ---------- */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f4f7f6 0%, #e8ecef 100%);
}

/* ---------- Invoice two-column layout (nueva_factura.php) ---------- */
#primero,
#segundo {
  transition: all .2s;
  border-radius: 8px !important;
  border: 1px solid #e0e0e0 !important;
  background: #fff;
  height: auto !important;
}
@media (max-width: 768px) {
  #primero,
  #segundo {
    width: 100% !important;
    float: none !important;
    height: auto !important;
    margin-bottom: 16px;
  }
}

/* Fix: selects and form elements inside #primero fully visible */
#primero select.form-control {
  height: 38px !important;
  font-size: 14px !important;
  padding: 8px 12px !important;
}

/* Force no horizontal scroll on any container */
div[style*="width:98%"],
div[style*="width: 98%"],
div[style*="width:96%"],
div[style*="width: 96%"] {
  max-width: 100% !important;
  overflow-x: hidden;
}

/* ---------- Utility ---------- */
.text-muted { color: #888; }
.text-primary { color: #4a6cf7; }
.text-success { color: #2ecc71; }
.text-danger { color: #e74c3c; }
.text-warning { color: #f39c12; }
