/* ============================================================
   AnacareSoft Company Portal — Global Styles
   ============================================================ */

/* ── Fuentes Anacare (icon font) ── */
@font-face {
  font-family: 'anacare';
  src: url('/portal/assets/fonts/anacare.eot?2ocfow');
  src: url('/portal/assets/fonts/anacare.eot?2ocfow#iefix') format('embedded-opentype'),
       url('/portal/assets/fonts/anacare.ttf?2ocfow') format('truetype'),
       url('/portal/assets/fonts/anacare.woff?2ocfow') format('woff'),
       url('/portal/assets/fonts/anacare.svg?2ocfow#anacare') format('svg');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

[class^="icon-"], [class*=" icon-"] {
  font-family: 'anacare' !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-logo_img:before { content: "\e900"; }
.icon-logo_str:before { content: "\e901"; }

/* ── Variables ── */
:root {
  --sidebar-width:   240px;
  --topbar-height:   54px;
  --font-mono:       SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sidebar-bg:      #1e2530;
  --sidebar-text:    #b8bfc9;
  --sidebar-hover:   #2d3748;
  --sidebar-active:  #3b82f6;
}

/* ── Base ── */
body {
  font-family: var(--font-mono);
  font-size: .875rem;
  background: #f1f3f5;
}

/* ── Sidebar ── */
.company-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.1rem 1rem .9rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.sidebar-brand .brand-icon {
  font-size: 2rem;
  color: #9ca3af;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-brand-text .brand-name {
  font-size: .78rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: .03em;
  display: block;
}

.sidebar-brand-text .brand-company {
  font-size: .72rem;
  color: var(--sidebar-text);
  display: block;
  margin-top: .1rem;
}

.sidebar-nav {
  list-style: none;
  padding: .5rem 0;
  margin: 0;
  flex: 1;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .8rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}

.sidebar-nav li a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav li a.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--sidebar-active);
}

.sidebar-footer {
  padding: .4rem 0;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .8rem;
  transition: background .15s, color .15s;
}

.sidebar-footer a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-footer a.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left: 3px solid var(--sidebar-active);
}

/* ── Topbar (always visible) ── */
.company-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: .75rem;
  z-index: 1030;
}

@media (min-width: 992px) {
  .company-topbar {
    left: var(--sidebar-width);   /* no tapa el sidebar en desktop */
  }
}

.topbar-toggle {
  background: none;
  border: none;
  padding: .3rem;
  cursor: pointer;
  color: #6c757d;
  line-height: 1;
}

.topbar-brand {
  font-size: .875rem;
  font-weight: 600;
  color: #212529;
}

/* ── Topbar user dropdown ── */
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: none;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  padding: .25rem .6rem;
  font-size: .8rem;
  color: #495057;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.topbar-user-btn:hover,
.topbar-user-btn:focus {
  background: #f8f9fa;
  border-color: #adb5bd;
  outline: none;
}
.topbar-user-btn::after { display: none; }   /* quita el caret de BS5 */

/* ── Botón de ayuda / tour ── */
.topbar-help-btn {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  padding: .28rem .5rem;
  cursor: pointer;
  color: #6c757d;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.topbar-help-btn:hover {
  background: #f8f9fa;
  border-color: var(--sidebar-active);
  color: var(--sidebar-active);
}

.topbar-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ── Main content ── */
.company-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: calc(var(--topbar-height) + 1.5rem) 1.5rem 1.5rem;
}

/* ── Overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1039;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .company-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }

  .company-main {
    margin-left: 0;
    padding-top: calc(var(--topbar-height) + 1rem);
  }

  body.sidebar-open .company-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }
}

/* ── Login ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f5;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
}
