/* ===== Brand Colors =====
  Navy:     #1a3a7a
  Sky Blue: #4ab5e3
  Amber:    #f5a823
  Bg:       #f0f6ff
========================= */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;font-family:'Segoe UI',system-ui,-apple-system,sans-serif;font-size:14px;color:#1e293b;background:#f0f6ff}
.app-shell{display:flex;height:100vh;overflow:hidden}

/* Sidebar */
.sidebar{width:230px;min-width:230px;background:#1a3a7a;color:#c8d8f0;display:flex;flex-direction:column;transition:width 0.2s}
.sidebar.collapsed{width:64px;min-width:64px}
.sidebar.collapsed .nav-label,.sidebar.collapsed .logo-text,.sidebar.collapsed .sidebar-footer-text{display:none}
.sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:14px 14px 12px;border-bottom:1px solid rgba(255,255,255,0.08)}
.logo{display:flex;align-items:center;gap:10px;text-decoration:none}
.logo img{height:38px;width:auto}
.logo-icon{font-size:24px;flex-shrink:0}
.logo-text{font-size:12px;font-weight:800;color:#fff;line-height:1.2;letter-spacing:0.02em}
.logo-text span{color:#4ab5e3}
.logo-text small{font-weight:400;color:rgba(255,255,255,0.4);font-size:10px;display:block;letter-spacing:0.05em}
.sidebar-toggle{background:none;border:none;color:rgba(255,255,255,0.3);font-size:18px;cursor:pointer;padding:4px;border-radius:4px;transition:color 0.15s}
.sidebar-toggle:hover{color:#fff}
.sidebar-nav{flex:1;padding:8px 0;overflow-y:auto}
.nav-item{display:flex;align-items:center;gap:12px;padding:11px 14px;color:rgba(255,255,255,0.55);text-decoration:none;border-left:3px solid transparent;transition:all 0.15s;white-space:nowrap;font-size:13px;position:relative}
.nav-item:hover{color:#fff;background:rgba(74,181,227,0.12)}
.nav-item.active{color:#fff;background:rgba(74,181,227,0.18);border-left-color:#4ab5e3}
.nav-icon{font-size:17px;flex-shrink:0;width:20px;text-align:center}
.nav-whatsapp:hover{background:rgba(37,211,102,0.1)!important}
.nav-whatsapp.active{border-left-color:#25d366!important;background:rgba(37,211,102,0.12)!important}
.sidebar-footer{padding:12px 14px;border-top:1px solid rgba(255,255,255,0.08)}
.user-row{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.user-avatar{width:30px;height:30px;border-radius:50%;background:#4ab5e3;color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.user-info{flex:1;min-width:0}
.user-name{font-size:12px;font-weight:600;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-credits{font-size:11px;color:#f5a823;font-weight:600}
.logout-btn{background:none;border:1px solid rgba(255,255,255,0.12);color:rgba(255,255,255,0.4);font-size:11px;padding:3px 8px;border-radius:4px;cursor:pointer;transition:all 0.15s;white-space:nowrap}
.logout-btn:hover{background:rgba(255,255,255,0.08);color:#fff}
.sms-status{display:flex;align-items:center;gap:6px;font-size:11px;color:rgba(255,255,255,0.3);padding-top:8px;border-top:1px solid rgba(255,255,255,0.08);margin-top:8px}

/* Main */
.main-content{flex:1;overflow-y:auto;padding:24px}
.tab-pane{display:none}
.tab-pane.active{display:block}

/* Page header */
.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;flex-wrap:wrap;gap:10px}
.page-header h2{font-size:20px;font-weight:800;color:#1a3a7a}
.page-actions{display:flex;gap:8px;flex-wrap:wrap}

/* Buttons */
.btn{display:inline-flex;align-items:center;gap:6px;padding:9px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none;transition:all 0.15s;text-decoration:none;line-height:1}
.btn-primary{background:#1a3a7a;color:#fff}
.btn-primary:hover{background:#142d60}
.btn-accent{background:#4ab5e3;color:#fff}
.btn-accent:hover{background:#3aa0cc}
.btn-amber{background:#f5a823;color:#fff}
.btn-amber:hover{background:#e09610}
.btn-secondary{background:#f0f6ff;color:#1a3a7a;border:1px solid #c8d8f0}
.btn-secondary:hover{background:#ddeeff}
.btn-danger{background:#ef4444;color:#fff}
.btn-danger:hover{background:#dc2626}
.btn-ghost{background:transparent;color:#64748b;border:1px solid #e2e8f0}
.btn-ghost:hover{background:#f8fafc;color:#334155}
.btn-sm{padding:5px 10px;font-size:12px;border-radius:6px}
.btn:disabled{opacity:0.5;cursor:not-allowed}

/* Cards */
.card{background:#fff;border-radius:12px;border:1px solid #dce8f8;padding:20px;margin-bottom:16px;box-shadow:0 1px 4px rgba(26,58,122,0.06)}
.card-title{font-size:14px;font-weight:700;color:#1a3a7a;margin-bottom:14px}

/* Stats */
.stats-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px;margin-bottom:20px}
.stat-card{background:#fff;border:1px solid #dce8f8;border-radius:12px;padding:16px;text-align:center;transition:box-shadow 0.15s;box-shadow:0 1px 4px rgba(26,58,122,0.06)}
.stat-card:hover{box-shadow:0 4px 16px rgba(26,58,122,0.12)}
.stat-value{font-size:26px;font-weight:800;color:#1a3a7a;line-height:1}
.stat-label{font-size:11px;color:#64748b;margin-top:6px;text-transform:uppercase;letter-spacing:0.04em}

/* Table */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table.table{width:100%;border-collapse:collapse;font-size:13px}
thead{background:#f0f6ff}
th{text-align:left;padding:10px 12px;font-weight:700;color:#1a3a7a;border-bottom:2px solid #dce8f8;white-space:nowrap;font-size:11px;text-transform:uppercase;letter-spacing:0.04em}
td{padding:11px 12px;border-bottom:1px solid #f0f6ff;color:#334155}
tr:hover td{background:#f7fbff}
tr:last-child td{border-bottom:none}
.checkbox-col{width:36px}

/* Badges */
.badge{display:inline-block;padding:3px 9px;border-radius:99px;font-size:11px;font-weight:600}
.badge-gray{background:#f1f5f9;color:#475569}
.badge-blue,.badge-navy{background:#e0eaff;color:#1a3a7a}
.badge-sky,.badge-teal{background:#e0f4fd;color:#0e7eb5}
.badge-green{background:#dcfce7;color:#15803d}
.badge-amber,.badge-yellow{background:#fff3cd;color:#b45309}
.badge-red{background:#fee2e2;color:#dc2626}
.badge-orange{background:#ffedd5;color:#c2410c}

/* Forms */
.form-group{margin-bottom:16px}
.form-label{display:block;font-size:11px;font-weight:700;color:#1a3a7a;margin-bottom:6px;text-transform:uppercase;letter-spacing:0.05em}
.form-control{width:100%;padding:9px 12px;border:1.5px solid #dce8f8;border-radius:8px;font-size:13px;color:#0f172a;background:#fff;transition:all 0.15s}
.form-control:focus{outline:none;border-color:#4ab5e3;box-shadow:0 0 0 3px rgba(74,181,227,0.15)}
textarea.form-control{min-height:110px;resize:vertical;line-height:1.5}
.form-hint{font-size:11px;color:#94a3b8;margin-top:5px;line-height:1.4}
.form-error{font-size:11px;color:#dc2626;margin-top:4px}
.char-counter{font-size:11px;color:#94a3b8;text-align:right}
.char-counter.warn{color:#d97706}
.char-counter.over{color:#dc2626}

/* Modal */
.modal-overlay{position:fixed;inset:0;background:rgba(26,58,122,0.45);z-index:100;display:flex;align-items:center;justify-content:center;padding:16px;backdrop-filter:blur(2px)}
.modal-overlay.hidden{display:none}
.modal{background:#fff;border-radius:14px;width:100%;max-width:500px;max-height:90vh;overflow-y:auto;box-shadow:0 24px 80px rgba(26,58,122,0.2)}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid #dce8f8;background:#f0f6ff;border-radius:14px 14px 0 0}
.modal-header h3{font-size:16px;font-weight:700;color:#1a3a7a}
.modal-close{background:none;border:none;font-size:22px;color:#94a3b8;cursor:pointer;line-height:1;border-radius:4px;transition:color 0.15s}
.modal-close:hover{color:#1a3a7a}
.modal-body{padding:20px}
.modal-footer{padding:14px 20px;border-top:1px solid #dce8f8;display:flex;justify-content:flex-end;gap:8px;background:#f0f6ff;border-radius:0 0 14px 14px}

/* Progress */
.progress-wrap{background:#dce8f8;border-radius:99px;height:8px;overflow:hidden;margin:8px 0}
.progress-bar{height:100%;background:linear-gradient(90deg,#1a3a7a,#4ab5e3);border-radius:99px;transition:width 0.4s ease}

/* Toast */
.toast-container{position:fixed;bottom:20px;right:20px;z-index:200;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.toast{background:#1a3a7a;color:#fff;padding:13px 16px;border-radius:10px;font-size:13px;max-width:320px;box-shadow:0 8px 30px rgba(26,58,122,0.3);animation:slideIn 0.25s ease;border-left:4px solid #4ab5e3;pointer-events:all}
.toast.error{border-left-color:#ef4444}
.toast.success{border-left-color:#22c55e}
.toast.info{border-left-color:#f5a823}
@keyframes slideIn{from{transform:translateX(110%);opacity:0}to{transform:translateX(0);opacity:1}}

/* Filter */
.filter-row{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap;align-items:center}
.search-input{flex:1;min-width:160px}

/* Empty state */
.empty-state{text-align:center;padding:60px 20px;color:#94a3b8}
.empty-state .empty-icon{font-size:52px;margin-bottom:14px}
.empty-state p{font-size:14px;margin-bottom:16px;line-height:1.5}

/* Dots */
.dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;display:inline-block}
.dot-gray{background:#94a3b8}
.dot-green{background:#22c55e}
.dot-red{background:#ef4444}
.dot-yellow{background:#f59e0b}
.dot-blue{background:#4ab5e3}

/* Mobile topbar */
.mobile-topbar{display:none;align-items:center;gap:10px;position:fixed;top:0;left:0;right:0;height:56px;background:#1a3a7a;padding:0 14px;z-index:40;border-bottom:1px solid rgba(74,181,227,0.2);box-shadow:0 2px 12px rgba(26,58,122,0.3)}
.mobile-hamburger{background:none;border:none;color:rgba(255,255,255,0.6);font-size:22px;cursor:pointer;padding:4px;border-radius:4px;flex-shrink:0}
.mobile-hamburger:hover{color:#fff}
.mobile-logo{display:flex;align-items:center;gap:8px}
.mobile-logo img{height:28px;width:auto;filter:brightness(0) invert(1)}
.mobile-logo-text{font-size:14px;font-weight:800;color:#fff}

/* Sidebar overlay */
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(26,58,122,0.5);z-index:49;backdrop-filter:blur(1px)}
.sidebar-overlay.visible{display:block}

/* Tablet */
@media(max-width:768px){
  .mobile-topbar{display:flex}
  .sidebar{position:fixed!important;top:0;left:0;bottom:0;z-index:50;width:260px!important;min-width:260px!important;transform:translateX(-100%);transition:transform 0.25s ease;box-shadow:4px 0 24px rgba(26,58,122,0.4)}
  .sidebar.open{transform:translateX(0)}
  .sidebar .nav-label,.sidebar .logo-text,.sidebar .sidebar-footer{display:block!important}
  .main-content{padding:72px 14px 24px}
  .modal-overlay{padding:0;align-items:flex-end}
  .modal{max-width:100%;max-height:94vh;border-radius:20px 20px 0 0}
  .modal-header{border-radius:20px 20px 0 0}
  .modal-footer{border-radius:0}
  .toast-container{left:12px;right:12px;bottom:16px}
  .toast{max-width:100%}
}

/* Mobile */
@media(max-width:640px){
  .main-content{padding:68px 12px 20px}
  .card{padding:14px;border-radius:10px}
  .page-header h2{font-size:18px}
  .stat-value{font-size:22px}
  .stats-row{grid-template-columns:repeat(2,1fr);gap:8px}
  [style*="grid-template-columns:1fr 1fr"],[style*="grid-template-columns: 1fr 1fr"]{grid-template-columns:1fr!important}
  [style*="repeat(auto-fit,minmax(150px"]{grid-template-columns:repeat(2,1fr)!important}
  [style*="repeat(auto-fit,minmax(130px"]{grid-template-columns:repeat(2,1fr)!important}
  th,td{padding:9px 8px}
  .btn{padding:8px 12px}
  .page-header{margin-bottom:14px}
  .modal-body{padding:16px}
}
