* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: #f2f4f7;
  color: #1f2a37;
}
.topbar {
  background: #123a5e;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar a { color: #cfe3ff; text-decoration: none; font-size: 14px; }
.topbar nav a { margin-inline-start: 16px; }

.wrap { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.card {
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.auth-card { max-width: 420px; margin: 60px auto; }
.auth-card h2 { margin-top: 0; text-align: center; color: #123a5e; }

label { display: block; margin: 12px 0 4px; font-size: 14px; font-weight: 600; }
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cfd6dd;
  border-radius: 6px;
  font-size: 14px;
}
fieldset { border: 1px solid #dfe4e9; border-radius: 8px; margin: 18px 0; padding: 14px 16px; }
legend { font-weight: 700; color: #123a5e; padding: 0 6px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.form-group {
  margin-bottom: 12px;
}
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.btn {
  display: inline-block;
  background: #1a6dc4;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #14548f; }
.btn.secondary { background: #6b7480; }
.btn.secondary:hover { background: #545c66; }
.btn.danger { background: #b02a2a; }
.btn.danger:hover { background: #8a2020; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-row { margin-top: 18px; display: flex; gap: 10px; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fde8e8; color: #922; border: 1px solid #f4bcbc; }
.alert.success { background: #e6f7ec; color: #1a7a3f; border: 1px solid #b7e6c6; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 10px; border-bottom: 1px solid #e5e9ed; text-align: center; font-size: 14px; }
th { background: #123a5e; color: #fff; }
tr:hover { background: #f7fafc; }

.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.search-box { display: flex; gap: 8px; margin-bottom: 16px; }
.search-box input { flex: 1; }

.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge.active, .badge.success { background: #e6f7ec; color: #1a7a3f; }
.badge.warning { background: #fef3c7; color: #b45309; }
.badge.danger { background: #fde8e8; color: #992222; }
.badge.secondary { background: #f3f4f6; color: #374151; }

.footer-note { text-align: center; color: #8a94a0; font-size: 12px; margin: 30px 0; }

.activity-grid{display:grid;grid-template-columns:2fr 1fr;gap:10px;align-items:end}.activity-grid>div{min-width:0}.activity-item>.remove-activity{margin-top:8px}@media(max-width:700px){.activity-grid{grid-template-columns:1fr}}

:root {
  --shell-sidebar-width: 260px;
  --shell-sidebar-collapsed-width: 70px;
  --shell-header-height: 64px;
  --shell-bg: #f2f4f7;
  --shell-sidebar-bg: #0f172a;
  --shell-sidebar-hover: #1e293b;
  --shell-sidebar-active: #3b82f6;
  --shell-sidebar-text: #94a3b8;
  --shell-sidebar-text-active: #ffffff;
  --shell-header-bg: #ffffff;
  --shell-border: #e2e8f0;
  --shell-text: #0f172a;
  --shell-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shell-transition: 0.25s ease-in-out;
}

body.admin-shell {
  margin: 0;
  background: var(--shell-bg);
  color: var(--shell-text);
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}


.sidebar {
  width: var(--shell-sidebar-width);
  background: var(--shell-sidebar-bg);
  color: var(--shell-sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: width var(--shell-transition), transform var(--shell-transition);
}
.sidebar-header {
  height: var(--shell-header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}
.brand-logo { width: 32px; height: 32px; border-radius: 4px; object-fit: contain; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-link, .nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--shell-sidebar-text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-group-toggle:hover {
  background: var(--shell-sidebar-hover);
  color: var(--shell-sidebar-text-active);
}
.nav-link.active {
  background: var(--shell-sidebar-active);
  color: var(--shell-sidebar-text-active);
}
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { width: 16px; height: 16px; transition: transform 0.2s; }
.profile-chevron { width: 16px; height: 16px; transition: transform 0.2s; }
.collapse-icon { transition: transform 0.2s; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}


.nav-submenu {
  display: none;
  flex-direction: column;
  padding-left: 32px;
  margin-top: 4px;
  gap: 4px;
}
.nav-group.expanded .nav-submenu { display: flex; }
.nav-group.expanded .nav-group-toggle .chevron { transform: rotate(180deg); }


.main-content {
  flex: 1;
  margin-left: var(--shell-sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left var(--shell-transition);
}


.app-header {
  height: var(--shell-header-height);
  background: var(--shell-header-bg);
  border-bottom: 1px solid var(--shell-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: var(--shell-shadow);
}
.header-left, .header-right { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 18px; margin: 0; font-weight: 600; color: var(--shell-text); }


.sidebar-toggle {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.sidebar-toggle:hover { background: #f1f5f9; color: #0f172a; }
.sidebar-toggle svg { width: 22px; height: 22px; }
.sidebar-toggle { display: none; }


.profile-menu { position: relative; }
.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.profile-btn:hover { background: #e2e8f0; border-color: #cbd5e1; }
.profile-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.profile-btn[aria-expanded="true"] .profile-chevron { transform: rotate(180deg); }
.avatar {
  width: 36px; height: 36px;
  background: #e0e7ff; color: #4338ca;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.profile-info { display: flex; flex-direction: column; text-align: left; }
.profile-name { font-size: 14px; font-weight: 600; color: #1e293b; }
.profile-role { font-size: 12px; color: #64748b; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header { padding: 12px 16px; border-bottom: 1px solid var(--shell-border); font-size: 13px; color: #64748b; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 10px 16px;
  background: transparent; border: none;
  font-size: 14px; color: #334155;
  cursor: pointer; font-family: inherit;
}
.dropdown-item:hover { background: #f1f5f9; }
.dropdown-item svg { width: 16px; height: 16px; }
.dropdown-menu form { margin: 0; }

.content-wrap { padding: 24px; }


.sidebar-collapsed .sidebar { width: var(--shell-sidebar-collapsed-width); }
.sidebar-collapsed .main-content { margin-left: var(--shell-sidebar-collapsed-width); }
.sidebar-collapsed .brand-text, 
.sidebar-collapsed .nav-text, 
.sidebar-collapsed .nav-group-toggle .chevron { display: none; }
.sidebar-collapsed .nav-link, 
.sidebar-collapsed .nav-group-toggle { justify-content: center; padding: 12px; }
.sidebar-collapsed .nav-submenu { padding-left: 0; position: absolute; left: 100%; top: 0; background: var(--shell-sidebar-bg); border-radius: 0 6px 6px 0; min-width: 180px; display: none; }
.sidebar-collapsed .nav-group:hover .nav-submenu { display: flex; }
.sidebar-collapsed .nav-submenu .nav-text { display: block; }
.sidebar-collapsed .nav-group { position: relative; }
.sidebar-collapsed .sidebar-header { padding: 0; justify-content: center; }
.sidebar-collapsed .collapse-icon { transform: rotate(180deg); }


.sidebar-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.5); z-index: 35;
  opacity: 0; visibility: hidden; transition: opacity 0.2s;
}
@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }
  .sidebar-footer { display: none; }
  .profile-info { display: none; }
  .sidebar { transform: translateX(-100%); width: 280px; }
  .main-content { margin-left: 0; }
  .sidebar-collapsed .main-content { margin-left: 0; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }
}


.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px; z-index: 50;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--shell-border);
  padding: 12px 16px; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 280px; max-width: 360px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-content { font-size: 14px; flex: 1; color: #1e293b; }
.toast-close {
  background: transparent; border: none; font-size: 18px; color: #94a3b8;
  cursor: pointer; line-height: 1; padding: 0; margin: 0;
}
.toast-close:hover { color: #475569; }
.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-info { border-left: 4px solid #3b82f6; }
.toast.fade-out { opacity: 0; transform: translateX(100%); transition: 0.3s; }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@media (max-width: 480px) {
  .toast-container { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
}


.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.6); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-content {
  background: #fff; border-radius: 10px;
  width: 100%; max-width: 480px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
  max-height: 90vh;
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--shell-border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { margin: 0; font-size: 18px; color: var(--shell-text); }
.modal-close {
  background: transparent; border: none; font-size: 24px; color: #94a3b8;
  cursor: pointer; line-height: 1; padding: 0; margin: 0;
}
.modal-close:hover { color: #475569; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-desc { margin: 0 0 16px 0; font-size: 14px; color: #64748b; }
.modal-divider { border: 0; border-top: 1px solid var(--shell-border); margin: 20px 0; }
.form-group { margin-bottom: 16px; }
.req { color: #ef4444; }
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { padding-right: 40px; }
.show-password-toggle {
  position: absolute; right: 8px; background: transparent; border: none;
  color: #94a3b8; cursor: pointer; padding: 4px; display: flex;
}
.show-password-toggle:hover { color: #475569; }
.show-password-toggle svg { width: 18px; height: 18px; }
.form-hint { display: block; font-size: 12px; color: #64748b; margin-top: 4px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--shell-border);
}

