/* ============================================================
   ISP Manager - Estilos principales (Tema Wisphub oscuro)
   ============================================================ */

:root {
    --sidebar-bg:       #020617;
    --sidebar-hover:    #0f172a;
    --sidebar-active:   #4361ee;
    --sidebar-text:     #a8adc3;
    --sidebar-heading:  #5c6291;
    --sidebar-width:    260px;
    --sidebar-width-sm: 70px;

    --topbar-bg:        #ffffff;
    --topbar-height:    60px;
    --topbar-border:    #e8ecf0;

    --body-bg:          #f0f2f7;
    --card-bg:          #ffffff;
    --card-shadow:      0 2px 10px rgba(0,0,0,.07);
    --card-radius:      10px;

    --primary:          #4361ee;
    --primary-dark:     #3451db;
    --success:          #2dbe6c;
    --warning:          #f6a821;
    --danger:           #e74c3c;
    --info:             #17a2b8;
    --secondary:        #6c757d;
    --light:            #f8f9fa;

    --text-primary:     #2d3436;
    --text-secondary:   #636e72;
    --text-muted:       #b2bec3;

    --border-color:     #e8ecf0;
    --input-border:     #d8dde5;
    --input-focus:      #4361ee;
    --radius:           8px;
    --radius-sm:        5px;
    --transition:       0.25s ease;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--body-bg); color: var(--text-primary); line-height: 1.6; }
a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
img { max-width: 100%; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body { background: linear-gradient(135deg, #1a1f3c 0%, #3451db 100%); min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo-icon { width: 70px; height: 70px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.login-logo-icon i { font-size: 30px; color: #fff; }
.login-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.login-logo p { color: var(--text-secondary); font-size: .9rem; }
.login-footer { margin-top: 20px; text-align: center; color: var(--text-secondary); }
.login-version { text-align: center; margin-top: 15px; color: rgba(255,255,255,.5); font-size: .8rem; }
.input-password-wrapper { position: relative; }
.input-password-wrapper .form-control { padding-right: 45px; }
.btn-toggle-pass { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar { width: var(--sidebar-width); background: var(--sidebar-bg); display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 1000; transition: width var(--transition); overflow: hidden; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: var(--topbar-height); flex-shrink: 0; }
.sidebar-logo { display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden; flex: 1; min-width: 0; }
.sidebar-logo i { font-size: 1.4rem; color: var(--primary); flex-shrink: 0; }
.sidebar-logo span { font-weight: 700; color: #fff; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logo-img {
    display: block;
    max-height: calc(var(--topbar-height) - 18px);
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.sidebar.collapsed .sidebar-logo-img { max-width: 32px; max-height: 32px; }
.sidebar-toggle { background: none; border: none; cursor: pointer; color: var(--sidebar-text); font-size: 1.1rem; padding: 5px; flex-shrink: 0; }
.sidebar-toggle:hover { color: #fff; }

.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 16px 20px; flex-shrink: 0; overflow: hidden; }
.sidebar-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: .9rem; flex-shrink: 0; }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--sidebar-text); font-size: .75rem; text-transform: capitalize; }
.sidebar-user-dept { color: #fff; font-size: .72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.sidebar-user-dept i { font-size: .66rem; margin-right: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.nav-section-title { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--sidebar-heading); padding: 12px 20px 5px; white-space: nowrap; overflow: hidden; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--sidebar-text); transition: all var(--transition); cursor: pointer; white-space: nowrap; }
.nav-item i { width: 20px; text-align: center; font-size: .95rem; flex-shrink: 0; }
.nav-item span { font-size: .9rem; overflow: hidden; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }

.sidebar-footer { padding: 15px 20px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.btn-logout { display: flex; align-items: center; gap: 10px; color: var(--sidebar-text); font-size: .9rem; transition: color var(--transition); white-space: nowrap; overflow: hidden; padding: 6px 8px; border-radius: 6px; }
.btn-logout:hover { color: var(--danger); }
.btn-logout.btn-profile:hover { color: var(--primary); background: rgba(59,130,246,.08); }
.btn-logout.btn-profile.active { color: var(--primary); background: rgba(59,130,246,.12); }
.btn-logout i { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-copyright { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.sidebar-copyright span { font-size: .68rem; color: rgba(255,255,255,.35); white-space: nowrap; line-height: 1.4; }

/* SUBMENU */
.nav-group { display: flex; flex-direction: column; }
.nav-group-toggle { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--sidebar-text); transition: all var(--transition); cursor: pointer; white-space: nowrap; user-select: none; }
.nav-group-toggle i.nav-icon { width: 20px; text-align: center; font-size: .95rem; flex-shrink: 0; }
.nav-group-toggle span { font-size: .9rem; flex: 1; overflow: hidden; }
.nav-group-toggle .nav-arrow { font-size: .7rem; flex-shrink: 0; transition: transform var(--transition); margin-left: auto; }
.nav-group-toggle:hover { background: var(--sidebar-hover); color: #fff; }
.nav-group-toggle.active-parent { color: #fff; }
.nav-group-toggle.open .nav-arrow { transform: rotate(90deg); }

.nav-submenu { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; }
.nav-submenu.open { max-height: 600px; }
.nav-submenu .nav-item { padding: 8px 20px 8px 50px; font-size: .875rem; }
.nav-submenu .nav-item::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sidebar-heading); margin-right: 10px; flex-shrink: 0; transition: background var(--transition); }
.nav-submenu .nav-item:hover::before,
.nav-submenu .nav-item.active::before { background: var(--primary); }

/* Collapsed: ocultar toggle-text y submenu */
.sidebar.collapsed .nav-group-toggle span,
.sidebar.collapsed .nav-arrow { display: none; }
.sidebar.collapsed .nav-group-toggle { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-submenu { display: none; }

/* Collapsed sidebar */
.sidebar.collapsed { width: var(--sidebar-width-sm); }
.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .btn-logout span,
.sidebar.collapsed .sidebar-copyright { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .sidebar-user { justify-content: center; }
.sidebar.collapsed .sidebar-header { justify-content: center; }

/* MAIN CONTENT */
.main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; transition: margin-left var(--transition); min-width: 0; }
.main-content.expanded { margin-left: var(--sidebar-width-sm); }
.app-footer { padding: 12px 28px; font-size: .75rem; color: var(--text-muted); text-align: center; border-top: 1px solid var(--border-color); margin-top: auto; flex-shrink: 0; }

/* TOPBAR */
.topbar { height: var(--topbar-height); background: var(--topbar-bg); border-bottom: 1px solid var(--topbar-border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.topbar-left { display: flex; align-items: center; gap: 15px; }
.topbar-toggle { background: none; border: none; cursor: pointer; color: var(--text-secondary); font-size: 1.1rem; padding: 5px; }
.topbar-toggle:hover { color: var(--primary); }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-muted); }
.breadcrumb-sep { color: var(--text-muted); font-size: .7rem; }
.topbar-right { display: flex; align-items: center; gap: 5px; }
.topbar-item { position: relative; }
.topbar-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 8px; border-radius: var(--radius-sm); font-size: .95rem; display: flex; align-items: center; gap: 8px; position: relative; }
.topbar-btn:hover { background: var(--body-bg); color: var(--primary); }
.topbar-user { font-size: .85rem; }
.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.topbar-username { color: var(--text-primary); font-weight: 500; }
.topbar-date { font-size: .82rem; color: var(--text-secondary); }
.badge-dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

/* DROPDOWN */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border-color); border-radius: var(--card-radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 200px; display: none; z-index: 200; }
.dropdown-menu.show { display: block; }
.dropdown-header { padding: 10px 16px; font-size: .78rem; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--text-primary); font-size: .875rem; transition: background var(--transition); }
.dropdown-item:hover { background: var(--body-bg); color: var(--primary); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger:hover { background: #fff5f5; color: var(--danger); }
.dropdown-divider { border: none; border-top: 1px solid var(--border-color); margin: 4px 0; }

/* PAGE CONTENT */
.page-content { padding: 24px; flex: 1; }

/* PAGE HEADER */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 15px; flex-wrap: wrap; }
.page-header-left h1 { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.page-header-left p { color: var(--text-secondary); font-size: .9rem; margin-top: 3px; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card { background: var(--card-bg); border-radius: var(--card-radius); box-shadow: var(--card-shadow); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header h2, .card-header h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border-color); background: #fafbfc; }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 20px; display: flex; align-items: center; gap: 16px; transition: transform var(--transition); }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-icon.primary  { background: rgba(67,97,238,.12);  color: var(--primary); }
.stat-icon.success  { background: rgba(45,190,108,.12); color: var(--success); }
.stat-icon.warning  { background: rgba(246,168,33,.12); color: var(--warning); }
.stat-icon.danger   { background: rgba(231,76,60,.12);  color: var(--danger); }
.stat-icon.info     { background: rgba(23,162,184,.12); color: var(--info); }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: .82rem; color: var(--text-secondary); margin-top: 3px; }
.stat-change { font-size: .78rem; margin-top: 5px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: #f7f8fc; color: var(--text-secondary); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 11px 16px; text-align: left; border-bottom: 2px solid var(--border-color); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-color); font-size: .875rem; color: var(--text-primary); }
tbody tr:hover td { background: #f8f9ff; }
tbody tr:last-child td { border-bottom: none; }
.table-actions { display: grid; grid-template-columns: repeat(3, auto); gap: 4px; justify-content: start; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.form-group label .required { color: var(--danger); }
.form-control { width: 100%; padding: 10px 14px; border: 1.5px solid var(--input-border); border-radius: var(--radius); font-size: .9rem; color: var(--text-primary); background: #fff; transition: border-color var(--transition), box-shadow var(--transition); }
.form-control:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px rgba(67,97,238,.12); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23636e72' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-text { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* FILTER BAR */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-control { min-width: 160px; }
.filter-bar .search-input { min-width: 240px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius); font-size: .875rem; font-weight: 600; cursor: pointer; border: none; transition: all var(--transition); text-decoration: none; white-space: nowrap; }
.btn i { font-size: .85rem; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-xs { padding: 4px 9px; font-size: .75rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover  { opacity: .9; color: #fff; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-warning:hover  { opacity: .9; color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { opacity: .9; color: #fff; }
.btn-info     { background: var(--info); color: #fff; }
.btn-info:hover     { opacity: .9; color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { opacity: .9; color: #fff; }
.btn-outline-primary { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-danger  { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-outline-danger:hover  { background: var(--danger); color: #fff; }
.btn-light { background: var(--body-bg); color: var(--text-primary); border: 1.5px solid var(--border-color); }
.btn-light:hover { background: var(--border-color); color: var(--text-primary); }

/* ============================================================
   BADGES
   ============================================================ */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.badge-primary   { background: rgba(67,97,238,.12);  color: var(--primary); }
.badge-success   { background: rgba(45,190,108,.12); color: var(--success); }
.badge-warning   { background: rgba(246,168,33,.15); color: #c77c00; }
.badge-danger    { background: rgba(231,76,60,.12);  color: var(--danger); }
.badge-info      { background: rgba(23,162,184,.12); color: var(--info); }
.badge-secondary { background: rgba(108,117,125,.12); color: var(--secondary); }
.badge-light     { background: var(--border-color); color: var(--text-secondary); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; position: relative; }
.alert i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(45,190,108,.1);  color: #1a7c42; border-left: 4px solid var(--success); }
.alert-error, .alert-danger { background: rgba(231,76,60,.1);  color: #c0392b; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(246,168,33,.1);  color: #876500; border-left: 4px solid var(--warning); }
.alert-info    { background: rgba(23,162,184,.1);  color: #0a7a8f; border-left: 4px solid var(--info); }
.alert-dismissible { padding-right: 40px; }
.btn-close-alert { position: absolute; right: 12px; top: 10px; background: none; border: none; cursor: pointer; font-size: 1.1rem; color: inherit; opacity: .6; line-height: 1; }
.btn-close-alert:hover { opacity: 1; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; gap: 5px; align-items: center; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); font-size: .85rem; border: 1.5px solid var(--border-color); color: var(--text-secondary); transition: all var(--transition); }
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.pagination .disabled { opacity: .4; cursor: not-allowed; }
.pagination-info { color: var(--text-secondary); font-size: .85rem; text-align: center; margin-top: 10px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1100; align-items: center; justify-content: center; }
.modal-backdrop.show { display: flex; }
.modal { background: #fff; border-radius: var(--card-radius); box-shadow: 0 20px 60px rgba(0,0,0,.2); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; animation: slideDown .2s ease; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-muted); padding: 0; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 20px; }
.chart-container { position: relative; height: 280px; }
.recent-table td { vertical-align: middle; }

/* ============================================================
   DETAIL PANELS
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-item { margin-bottom: 14px; }
.detail-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-bottom: 3px; }
.detail-value { font-size: .9rem; color: var(--text-primary); font-weight: 500; }

/* TIMELINE TICKETS */
.timeline { position: relative; }
.timeline::before { content: ''; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: var(--border-color); }
.timeline-item { display: flex; gap: 16px; margin-bottom: 20px; position: relative; }
.timeline-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--body-bg); border: 2px solid var(--border-color); display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; z-index: 1; }
.timeline-content { flex: 1; background: var(--body-bg); border-radius: var(--radius); padding: 12px 16px; }
.timeline-meta { font-size: .78rem; color: var(--text-muted); margin-bottom: 5px; }
.timeline-note { font-size: .875rem; }
.internal-note { border-left: 3px solid var(--warning); background: rgba(246,168,33,.05); }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.text-danger    { color: var(--danger) !important; }
.text-info      { color: var(--info) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.fw-bold        { font-weight: 700; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: .3; display: block; }
.empty-state p { font-size: 1rem; }

/* SPEED BADGE */
.speed-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: rgba(67,97,238,.08); color: var(--primary); border-radius: 20px; font-size: .8rem; font-weight: 600; }

/* AVATAR INITIALS */
.avatar-initials { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { width: 0; }
    .sidebar.mobile-open { width: var(--sidebar-width); }
    .main-content { margin-left: 0; }
    .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header { flex-direction: column; }
    .topbar-username { display: none; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
}

/* ============================================================
   SETTINGS MODULE
   ============================================================ */
.settings-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.settings-sidenav {
    width: 220px;
    flex-shrink: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 0;
}
.settings-sidenav-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    padding: 8px 16px 4px;
}
.settings-sidenav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}
.settings-sidenav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: .88rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.settings-sidenav-item:hover {
    background: #f0f2f7;
    color: var(--primary);
}
.settings-sidenav-item.active {
    background: #e8ecfe;
    color: var(--primary);
    font-weight: 600;
}
.settings-main {
    flex: 1;
    min-width: 0;
}
.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
}
.avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .settings-layout { flex-direction: column; }
    .settings-sidenav { width: 100%; }
}

/* ── Stats tabs ─────────────────────────────────────────────── */
.stats-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 6px;
    box-shadow: var(--card-shadow);
}
.stats-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.stats-tab:hover  { background: var(--bg-secondary); color: var(--text-primary); }
.stats-tab.active { background: var(--primary); color: #fff; }
.stats-tab i      { font-size: .82rem; }
@media (max-width: 600px) { .stats-tab span { display: none; } }

/* Stat cards clickeables (hover sutil que indica que llevan a otra vista) */
.stat-card-link { transition: transform .15s, box-shadow .15s; cursor: pointer; }
.stat-card-link:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }

/* ── Validación: resalta campos obligatorios vacíos al intentar Guardar ── */
.was-validated .form-control:invalid,
.was-validated input:invalid,
.was-validated select:invalid,
.was-validated textarea:invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, .15) !important;
}
.was-validated .form-control:invalid:focus,
.was-validated input:invalid:focus,
.was-validated select:invalid:focus,
.was-validated textarea:invalid:focus {
    outline: none;
}
.was-validated .form-group:has(:invalid) label {
    color: var(--danger);
}

/* Phone input with country code */
.phone-field-wrap { margin-bottom: 0; }
.phone-input-group { display: flex; gap: 0; }
.phone-input-group .phone-lada-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 120px;
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
}
.phone-input-group .phone-number-input {
    flex: 1 1 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}
