/* ===== VARIABLES — mismo tema que app-secretaria ===== */
:root {
  --gold:        #C9A84C;
  --gold-dark:   #8B6914;
  --gold-light:  #E8D5A3;
  --gold-border: #C9A84C;
  --marble-bg:   #F8F6F3;
  --bg:          #f0ede8;
  --text-dark:   #2C2410;
  --text-mid:    #5C4A1E;
  --text-light:  #8B7336;
  --white:       #FFFFFF;
  --shadow:      0 2px 12px rgba(139,105,20,0.10);
  --shadow-deep: 0 4px 24px rgba(139,105,20,0.13);
}

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--text-dark);
  display: flex;
  min-height: 100vh;
}

a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--gold); }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 200px;
  min-width: 200px;
  background: rgba(255,255,255,0.92);
  border-right: 1px solid var(--gold-light);
  min-height: 100vh;
  flex-shrink: 0;
}

.sidebar-sucursal {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gold-dark);
}
.sidebar-sucursal::before {
  content: '⊹';
  font-size: 11px;
  opacity: 0.8;
}

.sidebar-section-header {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-menu {
  list-style: none;
  background: rgba(255,255,255,0.85);
}
.sidebar-menu li a {
  display: block;
  padding: 7px 14px;
  color: var(--text-mid);
  font-size: 11.5px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: all 0.12s;
}
.sidebar-menu li a:hover {
  background: rgba(201,168,76,0.10);
  color: var(--gold-dark);
  text-decoration: none;
}
.sidebar-menu li a.active,
.sidebar-menu li.active a {
  font-weight: 700;
  color: var(--gold-dark);
  background: rgba(201,168,76,0.08);
  border-left: 3px solid var(--gold);
  padding-left: 11px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 20px 24px;
  background: var(--marble-bg);
  overflow-x: auto;
  position: relative;
}

/* Logo watermark — fondo de marca */
.main-content::before {
  content: '';
  position: fixed;
  top: 50%;
  left: calc(100px + 50vw); /* centro del área de contenido (viewport - 200px sidebar) */
  transform: translate(-50%, -50%);
  width: 680px;
  height: 680px;
  background-image: url('/img/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
}

/* Asegura que el contenido esté encima del watermark */
.main-content > * {
  position: relative;
  z-index: 1;
}

.page-title {
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ===== CARDS ===== */
.card {
  background: rgba(255,255,255,0.90);
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}
/* Decorative inner gold border */
.card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 3px;
  pointer-events: none;
}
.card-body {
  padding: 18px;
}

/* ===== TABLE CARD ===== */
.table-card {
  background: rgba(255,255,255,0.90);
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.table-card-header {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.5px;
}

.table-card-header .badge-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
}

/* ===== TABLES ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 0;
}
.table thead tr th {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  border: none;
  letter-spacing: 0.3px;
}
.table tbody tr td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
  vertical-align: middle;
  color: var(--text-dark);
}
.table tbody tr:hover { background: rgba(201,168,76,0.06); }
.table tbody tr:last-child td { border-bottom: none; }
.table .tac { text-align: center; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 6px 16px;
  border: none;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Montserrat', Arial, sans-serif;
  transition: all 0.15s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Gold (primary action) */
.btn-green {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
}

/* Dark gold (secondary action) */
.btn-blue {
  background: var(--gold-dark);
  color: #fff;
}

/* Outlined gold */
.btn-gray {
  background: transparent;
  border: 1px solid var(--gold-border);
  color: var(--gold-dark);
}
.btn-gray:hover { background: var(--gold-light); opacity: 1; transform: none; }

/* Danger (cancel, delete) */
.btn-red  { background: #8B2020; color: #fff; }

.btn-sm     { padding: 4px 10px; font-size: 10px; }
.btn-block  { display: block; width: 100%; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 10px; }
.form-group label {
  display: block;
  font-size: 10px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--gold-light);
  border-bottom: 2px solid var(--gold-light);
  border-radius: 2px;
  font-size: 12px;
  font-family: 'Montserrat', Arial, sans-serif;
  background: rgba(255,255,255,0.80);
  color: var(--text-dark);
  height: 30px;
  transition: border 0.15s, background 0.15s;
}
textarea.form-control { height: auto; }
select.form-control { height: 30px; }
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  border-bottom-color: var(--gold-dark);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}
.upper { text-transform: uppercase; }
.form-control[readonly] {
  background: rgba(248,245,240,0.90);
  color: var(--text-mid);
  border-color: rgba(201,168,76,0.30);
}

/* ===== GRID (Bootstrap-like) ===== */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.row > [class*="col-"] { padding: 0 8px; }
.col-1  { flex: 0 0 8.333%;  max-width: 8.333%; }
.col-2  { flex: 0 0 16.667%; max-width: 16.667%; }
.col-3  { flex: 0 0 25%;     max-width: 25%; }
.col-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-5  { flex: 0 0 41.667%; max-width: 41.667%; }
.col-6  { flex: 0 0 50%;     max-width: 50%; }
.col-7  { flex: 0 0 58.333%; max-width: 58.333%; }
.col-8  { flex: 0 0 66.667%; max-width: 66.667%; }
.col-9  { flex: 0 0 75%;     max-width: 75%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-12 { flex: 0 0 100%;    max-width: 100%; }

/* ===== ALERTS / FLASH ===== */
.alert {
  padding: 9px 14px;
  border-radius: 3px;
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.alert-success {
  background: rgba(201,168,76,0.12);
  color: var(--gold-dark);
  border: 1px solid var(--gold-light);
}
.alert-danger {
  background: rgba(139,32,32,0.08);
  color: #8B2020;
  border: 1px solid rgba(139,32,32,0.25);
}

/* ===== LABELS / BADGES ===== */
.label {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.label-success  { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); }
.label-danger   { background: #8B2020; }
.label-warning  { background: #8B5E14; }
.label-primary  { background: var(--gold-dark); }
.label-default  { background: #9B8A6A; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  list-style: none;
  gap: 4px;
  padding: 10px 14px;
}
.pagination li a,
.pagination li span {
  display: block;
  padding: 4px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  font-size: 11px;
  color: var(--gold-dark);
  text-decoration: none;
  transition: all 0.12s;
}
.pagination li a:hover {
  background: var(--gold-light);
  text-decoration: none;
}
.pagination li.active a,
.pagination li.active span {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  border-color: var(--gold-dark);
}

/* ===== LOGIN ===== */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  width: 100%;
}
.login-card {
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  box-shadow: var(--shadow-deep);
  padding: 40px 48px;
  width: 360px;
  position: relative;
}
.login-card::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(201,168,76,0.20);
  border-radius: 3px;
  pointer-events: none;
}
.login-card h2 {
  text-align: center;
  color: var(--gold-dark);
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.login-sep {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 14px 0 22px;
}
.login-card .logo-wrap {
  text-align: center;
  margin-bottom: 20px;
}
.login-card .logo-wrap img { max-height: 80px; }
.login-card .form-group label {
  color: var(--text-light);
  letter-spacing: 2px;
  font-size: 10px;
}
.login-card .form-control {
  border: none;
  border-bottom: 1.5px solid var(--gold-light);
  border-radius: 0;
  background: transparent;
  padding: 9px 4px;
  font-size: 14px;
  letter-spacing: 1px;
}
.login-card .form-control:focus {
  border-bottom-color: var(--gold);
  box-shadow: none;
}
.login-card .btn {
  width: 100%;
  padding: 13px;
  letter-spacing: 3px;
  font-size: 11px;
}

/* ===== MISC ===== */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-light); }
.mt10 { margin-top: 10px; }
.mb10 { margin-bottom: 10px; }
.p10  { padding: 10px; }
.p14  { padding: 14px; }

/* Input group */
.input-group { display: flex; }
.input-group .form-control { border-radius: 2px 0 0 2px; }
.input-group .btn { border-radius: 0 2px 2px 0; flex-shrink: 0; }

/* Small */
small { font-size: 11px; color: var(--text-light); }

/* Ver selector */
.ver-selector {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-light);
  background: rgba(248,245,240,0.60);
  border-bottom: 1px solid rgba(201,168,76,0.10);
}
.ver-selector select {
  margin: 0 4px;
  padding: 2px 6px;
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  font-size: 11px;
  background: #fff;
}

/* Nav tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px 0;
  border-bottom: 2px solid var(--gold);
}
.nav-tabs .tab {
  padding: 5px 14px;
  background: rgba(201,168,76,0.10);
  border: 1px solid var(--gold-light);
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  font-size: 11px;
  color: var(--gold-dark);
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.5px;
}
.nav-tabs .tab.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  border-color: var(--gold-dark);
}

/* Checkbox labels */
.check-label {
  font-size: 11px;
  color: var(--text-mid);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.check-label-gold {
  color: var(--gold-dark);
  font-weight: 700;
}
