/* ==========================================================================
   SIP HD - PORTAL ADMIN & MEDICAL STAFF STYLESHEET
   Professional Desktop Healthcare Administration Dashboard
   ========================================================================== */

.admin-body {
  background: #F1F5F9;
  color: #1E293B;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-x: hidden;
}

/* Topbar */
.admin-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-box {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0E9F8E 0%, #0A7B6E 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(14, 159, 142, 0.3);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  color: #0E9F8E;
  line-height: 1.1;
}

.brand-title span {
  color: #1E293B;
  font-size: 14px;
  font-weight: 600;
  margin-left: 4px;
}

.brand-subtitle {
  font-size: 11px;
  color: #64748B;
  font-weight: 500;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-switch-app {
  background: #E6F7F5;
  color: #0E9F8E;
  border: 1px solid rgba(14, 159, 142, 0.3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 9999px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s ease;
}

.btn-switch-app:hover {
  background: #0E9F8E;
  color: #FFFFFF;
}

.admin-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid #E2E8F0;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  background: #0E9F8E;
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.admin-user-meta {
  display: flex;
  flex-direction: column;
}

.admin-name {
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.2;
}

.admin-role {
  font-size: 11px;
  color: #64748B;
}

/* Layout */
.admin-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 68px);
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.8px;
  padding: 0 14px 10px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #475569;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: 0.15s ease;
  width: 100%;
}

.admin-nav-item i {
  font-size: 16px;
  width: 20px;
  color: #94A3B8;
  transition: 0.15s ease;
}

.admin-nav-item:hover {
  background: #F8FAFC;
  color: #0E9F8E;
}

.admin-nav-item:hover i {
  color: #0E9F8E;
}

.admin-nav-item.active {
  background: #E6F7F5;
  color: #0E9F8E;
  font-weight: 700;
}

.admin-nav-item.active i {
  color: #0E9F8E;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #E2E8F0;
}

.system-status-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #64748B;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  background: #F8FAFC;
}

.admin-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.admin-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.panel-title {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.3px;
}

.panel-subtitle {
  font-size: 13px;
  color: #64748B;
  margin-top: 2px;
}

/* Buttons */
.btn-action-primary {
  background: linear-gradient(135deg, #0E9F8E 0%, #0A7B6E 100%);
  color: #FFFFFF;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(14, 159, 142, 0.25);
  transition: 0.15s ease;
}

.btn-action-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 159, 142, 0.35);
}

.btn-action-secondary {
  background: #FFFFFF;
  color: #475569;
  border: 1px solid #CBD5E1;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn-action-secondary:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.btn-text-link {
  background: none;
  border: none;
  color: #0E9F8E;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-text-link:hover {
  text-decoration: underline;
}

/* Stat Cards */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.icon-teal { background: #E6F7F5; color: #0E9F8E; }
.icon-blue { background: #EFF6FF; color: #3B82F6; }
.icon-purple { background: #F5F3FF; color: #8B5CF6; }
.icon-amber { background: #FEF3C7; color: #D97706; }

.stat-label {
  font-size: 12px;
  color: #64748B;
  font-weight: 600;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
  margin: 2px 0;
}

.stat-hint {
  font-size: 11px;
  color: #94A3B8;
}

/* Card Box Container */
.admin-card-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.box-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-box-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.card-box-title i {
  color: #0E9F8E;
}

/* Quick Action Buttons Grid */
.quick-action-btns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.quick-btn {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  transition: 0.15s ease;
}

.quick-btn i {
  font-size: 20px;
  color: #0E9F8E;
}

.quick-btn:hover {
  background: #E6F7F5;
  border-color: #0E9F8E;
  color: #0E9F8E;
  transform: translateY(-2px);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.admin-table th {
  background: #F8FAFC;
  padding: 12px 14px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1.5px solid #E2E8F0;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #FAFCFD;
}

.tbl-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-tbl-sm {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: 0.15s ease;
}

.btn-tbl-sm:hover {
  background: #0E9F8E;
  color: #FFFFFF;
  border-color: #0E9F8E;
}

.btn-tbl-sm.danger:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

/* Forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.admin-form-group {
  margin-bottom: 16px;
}

.admin-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.admin-input {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFFFF;
  color: #0F172A;
  outline: none;
  transition: 0.15s ease;
}

.admin-input:focus {
  border-color: #0E9F8E;
  box-shadow: 0 0 0 3px rgba(14, 159, 142, 0.2);
}

.form-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #F1F5F9;
}

/* Modals */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
}

.admin-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.admin-modal-card {
  background: #FFFFFF;
  border-radius: 20px;
  width: 580px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: 0.2s ease;
}

.admin-modal-overlay.open .admin-modal-card {
  transform: scale(1);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E2E8F0;
}

.admin-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
}

.btn-close-admin-modal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-close-admin-modal:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

/* Admin Toast */
.admin-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast i {
  color: #34D399;
}

/* Responsive */
@media (max-width: 1024px) {
  .stat-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
  .quick-action-btns {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #E2E8F0;
  }
  .stat-cards-grid {
    grid-template-columns: 1fr;
  }
  .quick-action-btns {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
}
