/* ─── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --brand:        #0060AE;
  --brand-dark:   #004d8c;
  --brand-light:  #e8f1fb;
  --sidebar-bg:   #0f2744;
  --sidebar-text: #4d82b4;
  --sidebar-active: #00305a;
  --text-dark:    #1e2d3d;
  --text-muted:   #5e6e82;
  --border:       #e2e8f0;
  --bg-subtle:    #f5f8fc;
}

/* ─── Base ──────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .875rem;
  color: var(--text-dark);
  background: #f8fafd;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  font-weight: 600;
}

h1 { padding-top: 20px; font-size: 1.5rem; }
h2 { font-size: 1.25rem; }

/* ─── Navbar ────────────────────────────────────────────────────────────────── */
header.navbar {
  background: #ffffff !important;
  border-bottom: 3px solid var(--brand);
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-brand {
  color: var(--brand) !important;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

header.navbar .nav-link {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 1rem 0.75rem;
}

header.navbar .nav-link:hover {
  color: var(--brand);
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 48px 0 0;
  background: var(--sidebar-bg) !important;
  box-shadow: 2px 0 8px rgba(0,0,0,.15);
}

.sidebar .nav-link {
  font-weight: 500;
  color: var(--sidebar-text);
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s;
}

.sidebar .nav-link:hover {
  color: #00305a;
  background: rgba(255,255,255,.07);
}

.sidebar .nav-link.active {
  color: var(--sidebar-active);
  background: rgba(0,96,174,.25);
  border-left-color: var(--brand);
  font-weight: 600;
}

.sidebar .nav-link .feather,
.sidebar .nav-link [data-feather] {
  margin-right: 6px;
  color: inherit;
  opacity: .9;
}

.sidebar .nav-link.active .feather,
.sidebar .nav-link.active [data-feather] {
  opacity: 1;
}

.sidebar-heading {
  font-size: .65rem;
  letter-spacing: .08em;
  color: #4a6a8a !important;
  padding: 0.75rem 1rem 0.25rem;
  margin: 0;
}

.sidebar-heading a {
  color: #4a6a8a !important;
}

/* Sub-nav links (e.g. Tendencias under Estadísticas) */
.sidebar .nav-sublink {
  padding-left: 2.4rem;
  font-size: 0.82rem;
}

/* Sucursales antiguas collapse */
#sucursalesAntiguas .nav-link {
  font-size: 0.78rem;
  opacity: .85;
}

/* ─── Feather icons ──────────────────────────────────────────────────────────── */
.feather {
  width: 15px;
  height: 15px;
  vertical-align: text-bottom;
}

/* ─── Main content area ─────────────────────────────────────────────────────── */
main {
  padding-top: 1.5rem;
}

.header {
  margin-bottom: 1.5rem;
}

.header h1 {
  padding-top: 0;
  margin-bottom: .15rem;
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

/* ─── Tables ────────────────────────────────────────────────────────────────── */
thead tr {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tr {
  font-size: 0.85rem;
  color: var(--text-dark);
}

.table>:not(:last-child)>:last-child>*,
table.dataTable.no-footer {
  border-bottom: 1px solid var(--border) !important;
}

table.dataTable thead th {
  border-bottom: 2px solid var(--border) !important;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.dt-buttons { padding-top: 0.5rem; }

.dt-button, .testbtn {
  background-color: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-dark);
  padding: 5px 14px;
  font-size: 0.78rem;
  border-radius: 4px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.dt-button:hover, .testbtn:hover {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

/* Bootstrap btn-outline-secondary override to match brand */
.btn-outline-secondary {
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-outline-secondary:hover,
.btn-outline-secondary.active {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ─── Alerts ────────────────────────────────────────────────────────────────── */
.alert.alert-info {
  margin: 0 0 1rem 0;
  background: var(--brand-light);
  border-color: #b8d4ef;
  color: var(--brand-dark);
  font-size: 0.85rem;
}

/* ─── DataTable filter ───────────────────────────────────────────────────────── */
div#molino_filter { padding: 10px 0; }
div#molino_filter label { font-size: 0.78rem; color: var(--text-muted); }

a.paginate_button.current, a.paginate_button {
  font-size: 0.78rem;
  border-radius: 4px;
}

/* ─── Date picker (jQuery UI) ────────────────────────────────────────────────── */
.date-div { float: right; }
.date-div input { height: 40px; font-size: 13px; width: 170px; float: right; }

.ui-widget {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: .85rem !important;
}

.ui-widget-header {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

.ui-widget-header a { color: #fff !important; }

/* Header buttons (arrows + year title) must stay on the blue background */
.ui-widget-header .ui-state-default,
.ui-widget-header .ui-button {
  background: transparent !important;
  border-color: transparent !important;
  color: #fff !important;
}

.ui-widget-header .ui-state-hover,
.ui-widget-header .ui-button:hover {
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.3) !important;
  color: #fff !important;
}

.ui-state-default,
.ui-widget-content .ui-state-default {
  background: #fff !important;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}

.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

.ui-state-hover,
.ui-widget-content .ui-state-hover {
  background: var(--brand-light) !important;
  color: var(--brand) !important;
  border-color: var(--border) !important;
}

select.ui-datepicker-month,
select.ui-datepicker-year {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  padding: 5px !important;
  border-color: var(--border);
}

/* ─── Table form inputs ──────────────────────────────────────────────────────── */
.input-form-table, .select-form-table {
  width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--border);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: inherit;
}

.input-form-table:focus, .select-form-table:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0,96,174,.15);
}

/* ─── Login ──────────────────────────────────────────────────────────────────── */
.form-signin {
  margin: 0 auto;
  width: 100%;
  max-width: 360px;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.form-signin .form-control {
  position: relative;
  box-sizing: border-box;
  height: auto;
  padding: 10px;
  font-size: 0.9rem;
  border-color: var(--border);
}

.form-signin .form-control:focus {
  z-index: 2;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0,96,174,.15);
}

.form-signin input[type="text"] {
  margin-bottom: -1px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.form-signin input[type="password"] {
  margin-bottom: 10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.form-group { padding-bottom: 15px; }
.form-group label.control-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
}
.form-group input { font-size: 0.85rem; }

/* ─── Bootstrap badge override ───────────────────────────────────────────────── */
.badge.bg-primary   { background-color: var(--brand) !important; }
.badge.bg-secondary { background-color: #6c7a8d !important; }

/* ─── Misc ───────────────────────────────────────────────────────────────────── */
.link-secondary { font-size: 14px; }
