* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #f0f2f5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; min-height: 100vh; }

/* ======= Sidebar Layout ======= */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 1000; transition: width 0.3s;
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
}
.sidebar-brand {
  padding: 20px 20px 12px; text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand h4 { color: #fff; margin: 0; font-weight: 700; font-size: 1.15rem; letter-spacing: 1px; }
.sidebar-brand small { color: rgba(255,255,255,0.5); font-size: 0.75rem; }
.sidebar-user {
  padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85); font-size: 0.85rem;
}
.sidebar-user .username { font-weight: 600; display: block; }
.sidebar-user .expiry { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 2px; display: block; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; color: rgba(255,255,255,0.65);
  text-decoration: none; transition: all 0.2s;
  font-size: 0.9rem; border-left: 3px solid transparent;
}
.sidebar-nav a i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: #4e73df; }
.sidebar-footer {
  padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; color: rgba(255,255,255,0.5);
  text-decoration: none; transition: all 0.2s; font-size: 0.85rem;
}
.sidebar-footer a:hover { background: rgba(255,255,255,0.06); color: #ff6b6b; }
.main-content {
  flex: 1; margin-left: 240px; padding: 24px 28px;
  min-height: 100vh;
}
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; padding-bottom: 14px;
  border-bottom: 1px solid #e9ecef;
}
.page-header h4 { margin: 0; font-weight: 700; color: #2d3748; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }

/* sidebar colors */
.sidebar.admin-sidebar { background: linear-gradient(180deg, #1e3a5f 0%, #2b5f8a 100%); }
.sidebar.user-sidebar { background: linear-gradient(180deg, #1e3a5f 0%, #2b5f8a 100%); }

/* ======= Cards ======= */
.card {
  border: none; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.card-header {
  border-radius: 12px 12px 0 0 !important; font-weight: 600;
  background: #f8f9fa; border-bottom: 1px solid #eee;
  padding: 14px 18px;
}
.stat-card {
  border-radius: 14px; border: none; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.stat-card .card-body { padding: 20px; }
.stat-card .stat-icon { font-size: 2rem; opacity: 0.3; position: absolute; top: 14px; right: 16px; }
.stat-card .card-title { font-size: 0.85rem; font-weight: 500; opacity: 0.85; margin-bottom: 6px; }
.stat-card .card-text { font-weight: 700; font-size: 1.8rem; margin: 0; }

/* ======= Tables ======= */
.table { margin-bottom: 0; }
.table th { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.table td { vertical-align: middle; }
.table-hover tbody tr { transition: background 0.15s; }
.table-container {
  background: #fff; border-radius: 12px; padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden;
}
.table-container .table { margin-bottom: 0; }
.table-container .table th { padding: 12px 14px; }
.table-container .table td { padding: 10px 14px; }
.table-container .pagination { padding: 12px 14px; margin: 0; }

/* ======= Buttons ======= */
.btn { border-radius: 8px; font-weight: 500; font-size: 0.85rem; padding: 7px 16px; transition: all 0.2s; }
.btn-sm { border-radius: 6px; padding: 4px 10px; font-size: 0.78rem; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.btn:active { transform: translateY(0); }
.btn i { margin-right: 4px; }

/* ======= Form ======= */
.form-control, .form-select {
  border-radius: 8px; border: 1px solid #ddd;
  padding: 8px 12px; font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus { border-color: #4e73df; box-shadow: 0 0 0 3px rgba(78,115,223,0.15); }
label { font-weight: 500; font-size: 0.85rem; margin-bottom: 4px; color: #444; }

/* ======= Badges ======= */
.badge { border-radius: 6px; font-weight: 500; padding: 4px 10px; font-size: 0.75rem; }
.badge.bg-purple { background: #6f42c1 !important; color: #fff; }

/* ======= Pagination ======= */
.pagination { margin-top: 0; }
.page-link { border: none; border-radius: 8px !important; margin: 0 2px; color: #555; font-size: 0.83rem; padding: 6px 12px; }
.page-item.active .page-link { background: #4e73df; box-shadow: 0 2px 6px rgba(78,115,223,0.3); }
.page-item .page-link:hover { background: #eef2f7; }

/* ======= Modal ======= */
.modal-content { border: none; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.modal-header { border-radius: 14px 14px 0 0; padding: 16px 20px; border-bottom: 1px solid #eee; }
.modal-header h5 { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-footer { border-radius: 0 0 14px 14px; border-top: 1px solid #eee; padding: 14px 20px; }

/* ======= Alert ======= */
.alert { border: none; border-radius: 10px; font-size: 0.88rem; }

/* ======= Small helpers ======= */
.text-muted-small { font-size: 0.78rem; color: #999; }
.gap-2 { gap: 0.5rem; }
.flex-wrap { flex-wrap: wrap; }

/* ======= Domain cards ======= */
.domain-card { border-radius: 12px; border: 1px solid #e9ecef; overflow: hidden; }
.domain-card .card-header {
  background: #f8f9fa; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ======= Responsive ======= */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-brand h4, .sidebar-brand small, .sidebar-user, .sidebar-nav a span, .sidebar-footer a span { display: none; }
  .sidebar-nav a { justify-content: center; padding: 12px; }
  .sidebar-footer a { justify-content: center; padding: 12px; }
  .sidebar-nav a i, .sidebar-footer a i { margin: 0; }
  .main-content { margin-left: 60px; padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ======= Login pages ======= */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #2b5f8a 100%);
}
.login-page.user-login { background: linear-gradient(135deg, #1e3a5f 0%, #2b5f8a 100%); }
.login-card { border: none; border-radius: 16px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.2); width: 100%; max-width: 400px; }
.login-card .card-header { padding: 28px 24px; text-align: center; border: none; }
.login-card .card-header h4 { margin: 0; font-weight: 700; font-size: 1.3rem; }
.login-card .card-header p { margin: 6px 0 0; opacity: 0.75; font-size: 0.85rem; }
.login-card .card-body { padding: 24px; }
.login-card .card-footer { padding: 14px 24px; text-align: center; background: #f8f9fa; border-top: 1px solid #eee; }
.login-card .card-footer a { color: #2b5f8a; font-weight: 500; }

/* Image thumbnail in tables */
.img-thumbnail-small { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }
