/* ============================================================
   Grupo Santa Olga - Intranet Design System
   CoreUI 5 + Bootstrap Icons + Custom
   Palette: Coca-Cola Red + Warm Neutrals
   Dials: DESIGN_VARIANCE=3 / MOTION_INTENSITY=1 / VISUAL_DENSITY=7
   ============================================================ */

/* === TOKENS === */
:root {
  --ryp-primary:        #f40000;
  --ryp-primary-dark:   #c20000;
  --ryp-accent:         #ff4040;
  --cui-primary:        #f40000;
  --cui-info:           #6ac9ce;
  --ryp-bg:             #f7f4f4;
  --ryp-surface:        #ffffff;
  --ryp-border:         #e8dada;
  --ryp-border-light:   #f2e8e8;
  --ryp-text:           #1a1515;
  --ryp-muted:          #5e5555;
  --ryp-label:          #3a2020;
  --ryp-danger:         #b42318;
  --ryp-radius:         0.5rem;
  --ryp-radius-sm:      0.375rem;
  --ryp-radius-lg:      0.75rem;
  --ryp-touch:          44px;
  --ryp-shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(80,0,0,0.04);
  --ryp-shadow:         0 2px 8px rgba(80,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --ryp-transition:     0.15s ease;
}

/* === BASE === */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', "Segoe UI", system-ui, -apple-system, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  font-size: 0.9375rem;
  background: var(--ryp-bg);
  color: var(--ryp-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.auth-shell { background: #f7f0f0; }

/* === SIDEBAR === */
.sidebar {
  --cui-sidebar-bg:                   #1a1a1a;
  --cui-sidebar-brand-bg:             #111111;
  --cui-sidebar-brand-color:          #ffffff;
  --cui-sidebar-nav-link-color:       rgba(255,255,255,0.68);
  --cui-sidebar-nav-link-icon-color:  rgba(255,255,255,0.42);
  --cui-sidebar-nav-link-hover-bg:    rgba(255,255,255,0.07);
  --cui-sidebar-nav-link-hover-color: rgba(255,255,255,0.92);
  --cui-sidebar-nav-link-active-bg:   rgba(244,0,0,0.22);
  --cui-sidebar-nav-link-active-color:#ffffff;
  font-size: 0.875rem;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 0.925rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.25rem;
}

.sidebar-brand-icon {
  width: 1.75rem;
  height: 1.75rem;
  background: var(--ryp-primary);
  border-radius: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar .nav-link {
  font-weight: 500;
  border-radius: var(--ryp-radius-sm);
  margin: 0 0.5rem;
  padding: 0.5rem 0.75rem;
  transition: background var(--ryp-transition), color var(--ryp-transition);
}

.sidebar .nav-link.active {
  background: var(--cui-sidebar-nav-link-active-bg);
  color: var(--cui-sidebar-nav-link-active-color) !important;
}

.sidebar .nav-link.active .nav-icon {
  color: rgba(255,255,255,0.85) !important;
}

.sidebar-nav { padding: 0.5rem 0; }

/* === TOPBAR === */
.intranet-topbar {
  background: var(--ryp-surface) !important;
  border-bottom: 1px solid var(--ryp-border) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-brand {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ryp-primary-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.topbar-brand-icon {
  width: 1.5rem;
  height: 1.5rem;
  background: var(--ryp-primary);
  border-radius: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.topbar-username {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ryp-label);
  text-decoration: none;
  transition: color var(--ryp-transition);
}
.topbar-username:hover { color: var(--ryp-primary); }

/* === CARDS === */
.card {
  border: 1px solid var(--ryp-border-light);
  border-radius: var(--ryp-radius-lg);
  box-shadow: var(--ryp-shadow-sm);
  background: var(--ryp-surface);
}

.card-header {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ryp-label);
  background: var(--ryp-bg);
  border-bottom: 1px solid var(--ryp-border-light);
  padding: 0.75rem 1.25rem;
  border-radius: var(--ryp-radius-lg) var(--ryp-radius-lg) 0 0 !important;
}

/* === BUTTONS === */
.btn {
  font-family: 'Inter', "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--ryp-radius);
  min-height: var(--ryp-touch);
  padding: 0.5rem 1rem;
  transition: background-color var(--ryp-transition), border-color var(--ryp-transition), box-shadow var(--ryp-transition);
}

.btn-sm {
  font-size: 0.8rem;
  min-height: 34px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--ryp-radius-sm);
}

.btn-lg {
  min-height: 52px;
  font-size: 0.9375rem;
  padding: 0.75rem 1.5rem;
}

.btn-primary {
  background-color: var(--ryp-primary);
  border-color: var(--ryp-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--ryp-primary-dark);
  border-color: var(--ryp-primary-dark);
  box-shadow: 0 4px 12px rgba(244,0,0,0.22);
}

.btn-outline-primary { color: var(--ryp-primary); border-color: var(--ryp-primary); }
.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--ryp-primary);
  border-color: var(--ryp-primary);
}

.btn-mobile-icon {
  width: var(--ryp-touch);
  height: var(--ryp-touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ryp-radius);
}

/* === FORM ELEMENTS === */
.form-control,
.form-select {
  font-family: 'Inter', "Segoe UI", system-ui, sans-serif;
  font-size: 0.9rem;
  border-radius: var(--ryp-radius-sm);
  border-color: var(--ryp-border);
  min-height: var(--ryp-touch);
  color: var(--ryp-text);
  transition: border-color var(--ryp-transition), box-shadow var(--ryp-transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--ryp-primary);
  box-shadow: 0 0 0 3px rgba(244,0,0,0.12);
  outline: none;
}

textarea.form-control { min-height: auto; }

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ryp-label);
  margin-bottom: 0.3rem;
}

.list-group-item {
  min-height: var(--ryp-touch);
  border-color: var(--ryp-border-light);
  font-size: 0.9rem;
}

/* === TABLES === */
.table {
  font-size: 0.875rem;
  color: var(--ryp-text);
}

.table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ryp-muted);
  border-bottom: 2px solid var(--ryp-border);
  padding: 0.6rem 0.75rem;
  white-space: nowrap;
  background: var(--ryp-bg);
}

.table tbody td {
  vertical-align: middle;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--ryp-border-light);
}

.table tbody tr:hover td { background: #fdf5f5; }
.table tbody tr:last-child td { border-bottom: none; }

/* === ALERTS === */
.alert {
  border-radius: var(--ryp-radius);
  font-size: 0.9rem;
  border-width: 1px;
}

/* === BADGES === */
.badge {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.72rem;
}

/* === INTRANET LAYOUT === */
.intranet-main-container {
  padding-bottom: 6.5rem;
  padding-top: 1.5rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ryp-primary-dark);
  margin-bottom: 0;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--ryp-muted);
  margin-top: 0.15rem;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* === DASHBOARD STAT CARDS === */
.dash-stat {
  background: var(--ryp-surface);
  border: 1px solid var(--ryp-border-light);
  border-radius: var(--ryp-radius-lg);
  border-top: 3px solid var(--ryp-primary);
  padding: 1.1rem 1.25rem 1rem;
  box-shadow: var(--ryp-shadow-sm);
  overflow: hidden;
}

.dash-stat--success { border-top-color: #1a7f3c; }
.dash-stat--info    { border-top-color: var(--ryp-accent); }
.dash-stat--warning { border-top-color: #b54708; }

.dash-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ryp-muted);
  margin-bottom: 0.45rem;
}

.dash-stat-icon {
  float: right;
  color: var(--ryp-primary);
  font-size: 1.4rem;
  opacity: 0.28;
  margin-top: -0.1rem;
}
.dash-stat--success .dash-stat-icon { color: #1a7f3c; }
.dash-stat--info    .dash-stat-icon { color: var(--ryp-accent); }

.dash-stat-number {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ryp-primary-dark);
}

/* === QUICK ACTION TILES === */
.mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.quick-action-tile {
  background: var(--ryp-primary);
  color: #fff;
  border-radius: var(--ryp-radius);
  text-decoration: none;
  padding: 1rem 0.9rem;
  min-height: 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  transition: background-color var(--ryp-transition), transform 0.12s ease;
}

.quick-action-tile:nth-child(2n) { background: var(--ryp-primary-dark); }

.quick-action-tile:hover {
  background: #aa0000;
  color: #fff;
  transform: translateY(-1px);
}

.quick-action-tile i    { font-size: 1.2rem; opacity: 0.85; }
.quick-action-tile span { font-size: 0.85rem; font-weight: 600; }

/* === DASHBOARD WORKER SECTIONS === */
.mobile-page-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ryp-primary-dark);
  margin-bottom: 1rem;
}

.mobile-section-card {
  border-radius: var(--ryp-radius-lg);
  background: var(--ryp-surface);
  border: 1px solid var(--ryp-border-light);
  box-shadow: var(--ryp-shadow-sm);
  overflow: hidden;
}

.mobile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ryp-border-light);
  background: var(--ryp-bg);
}

.mobile-section-head h5 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ryp-label);
}

.mobile-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.75rem 0.75rem;
}

.mobile-list-item {
  border: 1px solid var(--ryp-border-light);
  border-radius: var(--ryp-radius);
  padding: 0.7rem 0.85rem;
  margin-top: 0.5rem;
  background: var(--ryp-surface);
}

.mobile-list-item-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ryp-text);
  margin-bottom: 0.2rem;
}

.mobile-list-item-meta {
  color: var(--ryp-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.mobile-list-item .btn { width: 100%; margin-top: 0.55rem; }

/* === MOBILE BOTTOM NAV === */
.mobile-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #111111;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 1045;
  padding: 0.3rem 0.25rem 0.4rem;
}

.mobile-bottom-item {
  text-decoration: none;
  color: rgba(255,255,255,0.60);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.1;
  min-height: 3.25rem;
  border-radius: var(--ryp-radius-sm);
  transition: color var(--ryp-transition), background var(--ryp-transition);
}

.mobile-bottom-item i { font-size: 1.15rem; }

.mobile-bottom-item:hover,
.mobile-bottom-item.active {
  background: rgba(244,0,0,0.20);
  color: #fff;
}

/* === MOBILE ROW CARDS === */
.mobile-cards { display: none; }

.mobile-row-card {
  background: var(--ryp-surface);
  border-radius: var(--ryp-radius);
  border: 1px solid var(--ryp-border-light);
  padding: 0.85rem;
  margin-bottom: 0.6rem;
}

.mobile-row-title  { font-size: 0.9rem; font-weight: 700; color: var(--ryp-text); }
.mobile-row-meta   { font-size: 0.8rem; color: var(--ryp-muted); }
.mobile-row-actions { display: flex; gap: 0.45rem; margin-top: 0.55rem; }
.mobile-row-actions .btn { flex: 1; }

/* === FORMS === */
.intranet-form-card {
  border-radius: var(--ryp-radius-lg);
  box-shadow: var(--ryp-shadow);
  border: 1px solid var(--ryp-border-light);
  background: var(--ryp-surface);
}

.intranet-form { display: grid; gap: 1rem; }

.intranet-form-animate {
  animation: formFadeUp 220ms ease-out;
}

@keyframes formFadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-field { display: grid; gap: 0.3rem; }

.required-mark { color: var(--ryp-danger); }

.intranet-input {
  border-color: var(--ryp-border);
  border-radius: var(--ryp-radius-sm);
  font-family: 'Inter', "Segoe UI", system-ui, sans-serif;
  transition: border-color var(--ryp-transition), box-shadow var(--ryp-transition);
}

.intranet-input:focus {
  border-color: var(--ryp-primary);
  box-shadow: 0 0 0 3px rgba(244,0,0,0.12);
  outline: none;
}

.intranet-file {
  border-radius: var(--ryp-radius-sm);
  padding: 0.55rem 0.75rem;
  border-color: var(--ryp-border);
  background: var(--ryp-bg);
}

.intranet-file::file-selector-button {
  border: 0;
  border-radius: var(--ryp-radius-sm);
  background: var(--ryp-primary);
  color: #fff;
  padding: 0.45rem 0.8rem;
  margin-right: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ryp-transition);
}

.intranet-file::file-selector-button:hover {
  background: var(--ryp-primary-dark);
}

.form-help  { font-size: 0.78rem; color: var(--ryp-muted); line-height: 1.4; }
.form-error { font-size: 0.78rem; color: var(--ryp-danger); font-weight: 600; }

.form-field.has-error .intranet-input,
.form-field.has-error .intranet-file {
  border-color: #f04438;
  box-shadow: 0 0 0 3px rgba(240,68,56,0.10);
}

.form-global-error {
  border: 1px solid #f3b7b3;
  background: #fef4f3;
  color: #8e2018;
  border-radius: var(--ryp-radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 0.5rem;
}
.form-actions .btn { min-width: 150px; }
.intranet-form-inline { margin: 0; }

/* === SEARCH === */
.employee-search-form .input-group-text {
  border-radius: var(--ryp-radius-sm) 0 0 var(--ryp-radius-sm);
  border-color: var(--ryp-border);
  background: var(--ryp-bg);
  color: var(--ryp-muted);
}
.employee-search-form .form-control { border-left: 0; }
.employee-search-form .btn {
  border-radius: 0 var(--ryp-radius-sm) var(--ryp-radius-sm) 0;
}

/* === REQUEST DETAIL === */
.request-meta-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

/* === COMMENTS === */
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.comment-list li {
  border: 1px solid var(--ryp-border-light);
  border-radius: var(--ryp-radius-sm);
  padding: 0.65rem 0.85rem;
  background: var(--ryp-bg);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* === AUTH === */
.auth-login-wrap {
  min-height: calc(100vh - 110px);
  display: flex;
  align-items: center;
}

.auth-brand-panel {
  background: linear-gradient(148deg, var(--ryp-primary-dark) 0%, var(--ryp-primary) 60%, var(--ryp-accent) 100%);
  color: #fff;
  border-radius: var(--ryp-radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 42px rgba(80,0,0,0.22);
}

.auth-brand-panel h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-bottom: 1rem;
}

.auth-brand-panel p {
  color: rgba(255,255,255,0.82);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.auth-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.10em;
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: rgba(255,255,255,0.60);
}

.auth-feature-list { display: grid; gap: 0.6rem; }

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--ryp-radius-sm);
  background: rgba(255,255,255,0.09);
  font-size: 0.875rem;
}
.auth-feature-item i { font-size: 1.05rem; }

.auth-card {
  border-radius: var(--ryp-radius-lg);
  box-shadow: 0 16px 40px rgba(80,0,0,0.10);
  border: 1px solid var(--ryp-border-light);
}

.auth-card .form-control {
  min-height: 50px;
  border-radius: var(--ryp-radius-sm);
  border-color: var(--ryp-border);
}
.auth-card .form-control:focus {
  border-color: var(--ryp-primary);
  box-shadow: 0 0 0 3px rgba(244,0,0,0.12);
}

.auth-footer-note {
  padding-top: 0.5rem;
  border-top: 1px solid var(--ryp-border-light);
}

/* === RESPONSIVE === */
@media (max-width: 991.98px) {
  .table-desktop { display: none; }
  .mobile-cards  { display: block; }
  .sidebar { width: 17rem; }
  .auth-login-wrap { min-height: auto; }
  .form-actions { display: grid; }
  .form-actions .btn { width: 100%; min-width: 0; }
  .intranet-main-container { padding-bottom: 6.5rem; }
}

@media (min-width: 992px) {
  .intranet-main-container { padding-bottom: 1.5rem; }

  /* Offset the wrapper when the sidebar is fixed and visible */
  body:not(.auth-shell) .wrapper {
    margin-left: var(--cui-sidebar-occupy-start, 16rem);
  }
}

@media (max-width: 575.98px) {
  body { font-size: 0.9rem; }
  .mobile-page-title { font-size: 1.2rem; }
  .quick-action-tile { min-height: 4.75rem; padding: 0.8rem 0.7rem; }
  .quick-action-tile span { font-size: 0.8rem; }
  .alert { font-size: 0.875rem; border-radius: var(--ryp-radius-sm); }
  .auth-brand-panel { padding: 1.5rem; border-radius: var(--ryp-radius); }
  .auth-brand-panel h1 { font-size: 1.55rem; }
  .auth-card { border-radius: var(--ryp-radius); }
  .dash-stat-number { font-size: 1.9rem; }
}

@media (max-width: 375px) {
  .mobile-bottom-item span { font-size: 0.6rem; }
  .mobile-bottom-item i    { font-size: 1rem; }
}
