/*
  Premium Aesthetic Design cho Web App Y tế
  Màu chủ đạo: Soft Blue, White, Clean Typography
*/

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #e0f2fe;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
}

/* Layout cơ bản CSS Grid */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 24px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand i {
  font-size: 1.8rem;
}

.sidebar-menu {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  transition: var(--transition);
}

.menu-item i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.menu-item:hover, .menu-item.active {
  background-color: var(--secondary);
  color: var(--primary);
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--background);
  min-width: 0; /* Important for flex child truncation */
}

/* Top Header */
.top-header {
  height: 70px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Page Content Padding */
.content-area {
  padding: 32px;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Gird Widgets cho Dashboard */
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  background-color: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.metric-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.metric-icon.blue { background: var(--secondary); color: var(--primary); }
.metric-icon.green { background: #d1fae5; color: var(--success); }
.metric-icon.red { background: #fee2e2; color: var(--danger); }

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.metric-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Tables Styling */
.table-container {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-header-toolbar {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-size: 1.1rem;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 16px 24px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background-color: #f8fafc;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}
.badge.pending { background: #fef3c7; color: #d97706; }
.badge.completed { background: #d1fae5; color: var(--success); }
.badge.cancelled { background: #fee2e2; color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgb(37 99 235 / 0.5);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 6px rgb(37 99 235 / 0.3);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background-color: #f8fafc;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--secondary);
  background-color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
  }
  .top-header {
    padding: 0 16px;
  }
  .content-area {
    padding: 20px 16px;
  }
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }
}
