/* ── Reset ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f5f6fa;color:#1a1a2e;min-height:100vh;}

/* ══════════════════════════════════════
   TOP BAR
══════════════════════════════════════ */
.topbar{
  height:56px;display:flex;align-items:center;
  background:#fff;border-bottom:1px solid #e8eaed;
  position:fixed;top:0;left:0;right:0;z-index:200;
  padding:0 20px;gap:12px;
}
.topbar-logo{
  display:flex;align-items:center;text-decoration:none;
  width:192px;flex-shrink:0;
}
.topbar-logo img{height:28px;object-fit:contain;}
.topbar-company{
  font-size:14px;color:#374151;flex:1;
  padding-left:16px;border-left:1px solid #e8eaed;
}
.topbar-icons{display:flex;align-items:center;gap:4px;margin-left:auto;}
.topbar-icon-btn{
  width:36px;height:36px;border-radius:8px;border:none;
  background:none;cursor:pointer;display:flex;align-items:center;
  justify-content:center;color:#6b7280;transition:background .15s;position:relative;
}
.topbar-icon-btn:hover{background:#f3f4f6;}
.topbar-icon-btn svg{width:20px;height:20px;}

/* User account hover dropdown */
.user-menu-wrap{position:relative;}
.user-dropdown{
  position:absolute;top:calc(100% + 8px);right:0;
  background:#fff;border:1px solid #e8eaed;border-radius:10px;
  box-shadow:0 6px 20px rgba(0,0,0,.11);min-width:190px;
  opacity:0;visibility:hidden;transform:translateY(-6px);
  transition:all .18s ease;z-index:500;overflow:hidden;
}
.user-menu-wrap:hover .user-dropdown{
  opacity:1;visibility:visible;transform:translateY(0);
}
.udrop-header{
  padding:13px 16px 11px;border-bottom:1px solid #f3f4f6;
}
.udrop-name{font-size:13px;font-weight:600;color:#111;}
.udrop-email{font-size:11.5px;color:#9ca3af;margin-top:2px;}
.udrop-item{
  display:flex;align-items:center;gap:9px;width:100%;
  padding:10px 16px;font-size:13px;color:#374151;
  background:none;border:none;cursor:pointer;
  text-align:left;font-family:inherit;transition:background .12s;
}
.udrop-item:hover{background:#f9fafb;}
.udrop-item svg{width:15px;height:15px;flex-shrink:0;}
.udrop-item.logout{color:#dc2626;}
.udrop-item.logout:hover{background:#fff1f2;}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar{
  width:200px;background:#fff;border-right:1px solid #e8eaed;
  position:fixed;top:56px;left:0;bottom:0;z-index:100;
  display:flex;flex-direction:column;
  transition:width .22s ease;overflow:hidden;
}
.sidebar.collapsed{width:54px;}

/* Pin menu button */
.pin-btn{
  display:flex;align-items:center;gap:7px;
  padding:11px 16px;border:none;background:none;
  cursor:pointer;font-family:inherit;font-size:12px;
  font-weight:500;color:#ea580c;white-space:nowrap;
  transition:background .15s;
}
.pin-btn:hover{background:#fff7ed;}
.pin-btn svg{width:15px;height:15px;flex-shrink:0;color:#ea580c;}
.pin-label{transition:opacity .18s;white-space:nowrap;}
.sidebar.collapsed .pin-label{opacity:0;width:0;overflow:hidden;}
.sidebar.collapsed .pin-btn{justify-content:center;padding:11px 0;}

/* Nav */
.nav-menu{flex:1;padding:6px 10px;display:flex;flex-direction:column;gap:2px;}
.nav-item{
  display:flex;align-items:center;gap:10px;
  padding:9px 10px;border-radius:8px;
  font-size:13.5px;color:#4b5563;cursor:pointer;
  border:none;background:none;font-family:inherit;
  text-align:left;white-space:nowrap;width:100%;
  transition:background .15s,color .15s;
}
.nav-item:hover{background:#f3f4f6;color:#111;}
.nav-item.active{background:#fff7ed;color:#ea580c;font-weight:500;}
.nav-item svg{width:18px;height:18px;flex-shrink:0;}
.nav-label{transition:opacity .18s;white-space:nowrap;}
.sidebar.collapsed .nav-label{opacity:0;width:0;overflow:hidden;}
.sidebar.collapsed .nav-item{justify-content:center;padding:9px 0;}

/* Sidebar footer */
.sidebar-footer{
  padding:12px 14px;border-top:1px solid #e8eaed;
  display:flex;align-items:center;gap:10px;overflow:hidden;
}
.s-avatar{
  width:32px;height:32px;border-radius:50%;
  background:#e5e7eb;display:flex;align-items:center;
  justify-content:center;font-size:11px;font-weight:600;
  color:#6b7280;flex-shrink:0;
}
.s-user-info{white-space:nowrap;transition:opacity .18s;}
.sidebar.collapsed .s-user-info{opacity:0;width:0;overflow:hidden;}
.s-user-name{font-size:12.5px;font-weight:600;color:#111;}
.s-user-email{font-size:11px;color:#9ca3af;}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main{
  margin-top:56px;margin-left:200px;
  min-height:calc(100vh - 56px);
  transition:margin-left .22s ease;
  background:#f5f6fa;
}
.main.collapsed{margin-left:54px;}

/* ══════════════════════════════════════
   PAGE
══════════════════════════════════════ */
.page{display:none;min-height:calc(100vh - 56px);}
.page.active{display:block;}

/* ══════════════════════════════════════
   DASHBOARD PAGE
══════════════════════════════════════ */
.dash-header{
  display:flex;align-items:flex-start;justify-content:space-between;
  padding:20px 28px 16px;background:#fff;
  border-bottom:1px solid #e8eaed;
}
.dash-header-left h2{font-size:18px;font-weight:600;color:#111;}
.dash-header-left p{font-size:13px;color:#6b7280;margin-top:3px;}

.btn-primary{
  background:#2563eb;color:#fff;border:none;border-radius:7px;
  padding:9px 20px;font-size:13.5px;font-weight:500;
  cursor:pointer;font-family:inherit;white-space:nowrap;
  transition:background .15s;
}
.btn-primary:hover{background:#1d4ed8;}
.btn-outline{
  background:#fff;color:#374151;border:1px solid #d1d5db;
  border-radius:7px;padding:9px 20px;font-size:13.5px;
  font-weight:500;cursor:pointer;font-family:inherit;
  white-space:nowrap;transition:background .15s;
}
.btn-outline:hover{background:#f9fafb;}

/* Stat cards row */
.stat-row{
  display:grid;grid-template-columns:repeat(3,1fr);
  gap:16px;padding:24px 28px 0;
}
.stat-card{
  border-radius:12px;padding:22px 24px;
}
.stat-card.blue{background:#dbeafe;}
.stat-card.purple{background:#f3e8ff;}
.stat-card.pink{background:#fce7f3;}
.stat-card-label{font-size:13px;color:#374151;margin-bottom:10px;font-weight:400;}
.stat-card-value{font-size:32px;font-weight:700;color:#111;}

/* Main body layout */
.dash-body{
  display:grid;grid-template-columns:1fr 300px;
  gap:20px;padding:20px 28px 28px;align-items:start;
}

/* Company overview card */
.overview-card{
  background:#fff;border:1px solid #e8eaed;
  border-radius:12px;overflow:hidden;
}
.overview-card-header{
  padding:18px 20px 14px;
  display:flex;align-items:center;justify-content:space-between;
}
.overview-card-header h3{font-size:15px;font-weight:600;color:#111;}

/* Search */
.search-wrap{
  display:flex;align-items:center;gap:8px;
  border:1px solid #e8eaed;border-radius:8px;
  padding:7px 12px;background:#f9fafb;
  margin:0 20px 14px;
}
.search-wrap svg{width:16px;height:16px;color:#9ca3af;flex-shrink:0;}
.search-wrap input{
  border:none;background:none;outline:none;font-size:13px;
  color:#374151;font-family:inherit;width:100%;
}
.search-wrap input::placeholder{color:#9ca3af;}

/* Table */
.co-table{width:100%;border-collapse:collapse;}
.co-table thead tr{background:#f9fafb;}
.co-table th{
  padding:11px 16px;text-align:left;font-size:12.5px;
  font-weight:600;color:#6b7280;border-top:1px solid #e8eaed;
  border-bottom:1px solid #e8eaed;white-space:nowrap;
}
.co-table td{
  padding:13px 16px;font-size:13.5px;color:#374151;
  border-bottom:1px solid #f3f4f6;vertical-align:middle;
}
.co-table tbody tr:hover{background:#fafafa;}
.co-table tbody tr:last-child td{border-bottom:none;}

/* status badges */
.badge{
  display:inline-flex;align-items:center;
  padding:3px 11px;border-radius:20px;font-size:12px;font-weight:500;
}
.badge-draft{background:#f3f4f6;color:#374151;border:1px solid #e5e7eb;}
.badge-saved{background:#d1fae5;color:#065f46;}
.badge-active{background:#d1fae5;color:#065f46;}
.badge-pending{background:#fef3c7;color:#92400e;}

/* 3-dot action */
.action-cell{position:relative;}
.dots-btn{
  width:28px;height:28px;border:none;background:none;cursor:pointer;
  border-radius:6px;color:#9ca3af;font-size:18px;line-height:1;
  display:flex;align-items:center;justify-content:center;
  transition:background .12s;font-family:inherit;
}
.dots-btn:hover{background:#f3f4f6;color:#374151;}
.dot-menu{
  position:absolute;right:32px;top:4px;z-index:50;
  background:#fff;border:1px solid #e8eaed;border-radius:9px;
  box-shadow:0 4px 16px rgba(0,0,0,.10);min-width:150px;
  display:none;overflow:hidden;
}
.dot-menu.open{display:block;}
.dot-item{
  display:block;width:100%;padding:10px 16px;font-size:13px;
  color:#374151;background:none;border:none;cursor:pointer;
  text-align:left;font-family:inherit;transition:background .12s;
}
.dot-item:hover{background:#f9fafb;}
.dot-item.danger{color:#dc2626;}
.dot-item.danger:hover{background:#fff1f2;}

/* Pagination */
.pagination-bar{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 16px;border-top:1px solid #f3f4f6;
  font-size:13px;color:#6b7280;
}
.pag-btns{display:flex;align-items:center;gap:4px;}
.pag-btn{
  min-width:30px;height:30px;padding:0 6px;border:1px solid #e8eaed;
  border-radius:6px;background:#fff;font-size:13px;color:#374151;
  cursor:pointer;font-family:inherit;transition:all .12s;
  display:flex;align-items:center;justify-content:center;
}
.pag-btn:hover{background:#f3f4f6;}
.pag-btn.active{background:#2563eb;color:#fff;border-color:#2563eb;}
.pag-btn:disabled{opacity:.4;cursor:not-allowed;}

/* ── Approval Requests panel ── */
.approval-panel{
  background:#fff;border:1px solid #e8eaed;border-radius:12px;
  overflow:hidden;
}
.ap-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 18px 8px;
}
.ap-header h3{font-size:15px;font-weight:600;color:#111;}
.ap-badge{
  background:#2563eb;color:#fff;font-size:11px;font-weight:600;
  padding:2px 9px;border-radius:20px;
}
.ap-subtitle{
  font-size:12px;color:#9ca3af;padding:0 18px 12px;
  border-bottom:1px solid #f3f4f6;
}
.ap-list{display:flex;flex-direction:column;}
.ap-item{padding:14px 18px;border-bottom:1px solid #f3f4f6;}
.ap-item:last-child{border-bottom:none;}
.ap-item-title{font-size:13.5px;font-weight:600;color:#111;margin-bottom:2px;}
.ap-item-email{font-size:12px;color:#9ca3af;}
.ap-item-time{
  display:flex;align-items:center;gap:4px;
  font-size:11.5px;color:#9ca3af;margin:6px 0 10px;
}
.ap-item-time svg{width:12px;height:12px;}
.ap-item-actions{display:flex;align-items:center;gap:8px;}
.btn-approve{
  background:#2563eb;color:#fff;border:none;border-radius:6px;
  padding:6px 16px;font-size:12.5px;font-weight:500;cursor:pointer;
  font-family:inherit;flex:1;transition:background .12s;
}
.btn-approve:hover{background:#1d4ed8;}
.btn-review{
  background:#fff;color:#374151;border:1px solid #d1d5db;
  border-radius:6px;padding:6px 16px;font-size:12.5px;font-weight:500;
  cursor:pointer;font-family:inherit;flex:1;transition:background .12s;
}
.btn-review:hover{background:#f9fafb;}
.ap-footer{
  padding:12px 18px;border-top:1px solid #f3f4f6;text-align:center;
}
.ap-footer a{
  font-size:13px;color:#2563eb;text-decoration:none;cursor:pointer;
}
.ap-footer a:hover{text-decoration:underline;}

/* ══════════════════════════════════════
   DRAWER (Add Company)
══════════════════════════════════════ */
.drawer-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.14);
  z-index:300;display:none;
}
.drawer-overlay.open{display:block;}
.drawer{
  position:fixed;top:56px;right:0;bottom:0;width:420px;
  background:#fff;border-left:1px solid #e8eaed;z-index:301;
  display:flex;flex-direction:column;
  transform:translateX(100%);transition:transform .25s ease;
}
.drawer.open{transform:translateX(0);}
.drawer-header{
  padding:20px 24px 16px;border-bottom:1px solid #f3f4f6;
}
.drawer-header h3{font-size:16px;font-weight:600;color:#111;}
.drawer-body{flex:1;overflow-y:auto;padding:22px 24px;}
.drawer-footer{
  padding:16px 24px;border-top:1px solid #f3f4f6;
  display:flex;justify-content:flex-end;gap:10px;
}

/* Form */
.form-group{margin-bottom:24px;}
.form-label{
  font-size:13px;font-weight:500;color:#374151;
  margin-bottom:8px;display:block;
}
.form-input{
  width:100%;border:none;border-bottom:1px solid #d1d5db;
  padding:8px 0;font-size:14px;color:#111;outline:none;
  background:transparent;font-family:inherit;
  transition:border-color .15s;
}
.form-input:focus{border-bottom-color:#2563eb;}
.form-input::placeholder{color:#9ca3af;}

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast{
  position:fixed;bottom:28px;right:28px;background:#111;color:#fff;
  padding:12px 20px;border-radius:8px;font-size:13.5px;
  opacity:0;transform:translateY(10px);
  transition:all .25s;pointer-events:none;z-index:9999;
}
.toast.show{opacity:1;transform:translateY(0);}

/* ══════════════════════════════════════
   CONFIRM MODAL
══════════════════════════════════════ */
.modal-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.28);
  z-index:600;display:none;align-items:center;justify-content:center;
}
.modal-overlay.open{display:flex;}
.modal-box{
  background:#fff;border-radius:14px;padding:28px;
  width:380px;box-shadow:0 8px 32px rgba(0,0,0,.14);
}
.modal-box h4{font-size:16px;font-weight:600;color:#111;margin-bottom:8px;}
.modal-box p{font-size:13.5px;color:#6b7280;line-height:1.6;}
.modal-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:22px;}