/* CRM Telecom — Global Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a56db;
  --primary-dark: #1340b0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --bg: #f3f4f6;
  --bg2: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text2: #6b7280;
  --sidebar-w: 240px;
  --header-h: 56px;
  --radius: 10px;
}

body { font-family: 'Inter', system-ui, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.6; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-wrap { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 2.5rem; width: 380px; }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; font-size: 18px; font-weight: 600; }
.login-wrap h2 { font-size: 20px; font-weight: 600; margin-bottom: 1.5rem; }

/* Layout */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: #111827; overflow-y: auto; z-index: 100; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 1.25rem 1rem; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid #1f2937; }
.sidebar-nav { padding: 1rem 0; }
.sidebar-group { padding: 0.5rem 1rem 0.25rem; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; }
.sidebar-nav a { display: flex; align-items: center; gap: 8px; padding: 0.55rem 1rem; color: #d1d5db; text-decoration: none; border-radius: 6px; margin: 1px 8px; font-size: 14px; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #1f2937; color: #fff; }
.sidebar-nav a .icon { width: 18px; text-align: center; }

.topbar { position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--header-h); background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; z-index: 99; }
.topbar-left { font-size: 15px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 1rem; font-size: 13px; color: var(--text2); }

.main-content { margin-left: var(--sidebar-w); padding-top: var(--header-h); min-height: 100vh; }
.content-inner { padding: 1.5rem; max-width: 1400px; }

/* Cards */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.card-body { padding: 1.25rem; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 1rem; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 1rem; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-card.stat-danger { border-color: var(--danger); }
.stat-val { display: block; font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { display: block; font-size: 12px; color: var(--text2); margin-top: 4px; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--text2); }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text); transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
textarea.form-control { resize: vertical; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: all .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-info      { background: var(--info); color: #fff; }
.btn-sm        { padding: 4px 10px; font-size: 12px; }
.btn-block     { width: 100%; }

/* Badges */
.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f3f4f6; color: #374151; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); background: #f9fafb; }
.table-hover tbody tr:hover { background: #f9fafb; }
.table-sm th, .table-sm td { padding: 6px 8px; }

/* Grid */
.row { display: flex; gap: 1rem; }
.col { flex: 1; min-width: 0; }
.col-4 { flex: 0 0 33.33%; min-width: 0; }
.col-5 { flex: 0 0 41.66%; min-width: 0; }
.col-6 { flex: 0 0 50%; min-width: 0; }
.col-7 { flex: 0 0 58.33%; min-width: 0; }
.col-8 { flex: 0 0 66.66%; min-width: 0; }

/* Utilities */
.d-flex { display: flex; }
.gap-2  { gap: 0.5rem; }
.gap-2  { gap: 0.5rem; }
.justify-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.text-muted, .text-muted { color: var(--text2); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info    { color: var(--info); }
.text-center  { text-align: center; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 1rem; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Page header */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 22px; font-weight: 700; }

/* Progress bar */
.progress-bar-wrap { display: inline-block; width: 80px; height: 8px; background: #e5e7eb; border-radius: 4px; margin-right: 6px; vertical-align: middle; }
.progress-bar-fill { height: 100%; border-radius: 4px; }

/* Paginação */
.paginacao { display: flex; gap: 4px; margin-top: 1rem; flex-wrap: wrap; }

/* Stat grid (small) */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-item { text-align: center; padding: 8px; background: var(--bg); border-radius: 8px; }
.stat-item .stat-val { font-size: 22px; font-weight: 700; display: block; }
.stat-item .stat-label { font-size: 11px; color: var(--text2); }

/* Tabs */
.tab-buttons { display: flex; gap: 4px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .row { flex-direction: column; }
  [class^="col-"] { flex: unset; }
}
