/* Material Design Colors */
:root {
  --md-primary: #1976d2;
  --md-primary-dark: #1565c0;
  --md-primary-light: #42a5f5;
  --md-secondary: #424242;
  --md-accent: #ff4081;
  --md-background: #fafafa;
  --md-surface: #ffffff;
  --md-error: #d32f2f;
  --md-success: #388e3c;
  --md-warning: #f57c00;
  --md-text-primary: rgba(0, 0, 0, 0.87);
  --md-text-secondary: rgba(0, 0, 0, 0.54);
  --md-divider: rgba(0, 0, 0, 0.12);
  --md-shadow-1: 0 2px 4px rgba(0,0,0,0.1);
  --md-shadow-2: 0 4px 8px rgba(0,0,0,0.12);
  --md-shadow-3: 0 8px 16px rgba(0,0,0,0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--md-background);
  color: var(--md-text-primary);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* Material Card */
.card {
  background: var(--md-surface);
  border-radius: 4px;
  box-shadow: var(--md-shadow-1);
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: var(--md-shadow-2);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #000000;
}

.card-content {
  color: var(--md-text-secondary);
}

/* Material Button */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--md-shadow-1);
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  box-shadow: var(--md-shadow-2);
  transform: translateY(-1px);
}

.btn:active {
  box-shadow: var(--md-shadow-1);
  transform: translateY(0);
}

.btn-primary {
  background: var(--md-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--md-primary-dark);
}

.btn-secondary {
  background: var(--md-secondary);
  color: white;
}

.btn-success {
  background: var(--md-success);
  color: white;
}

.btn-error {
  background: var(--md-error);
  color: white;
}

.btn-flat {
  background: transparent;
  color: var(--md-primary);
  box-shadow: none;
}

.btn-flat:hover {
  background: rgba(25, 118, 210, 0.08);
  box-shadow: none;
}

/* Material Input */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--md-divider);
  background: transparent;
  font-size: 16px;
  color: var(--md-text-primary);
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-bottom: 2px solid var(--md-primary);
}

.form-control::placeholder {
  color: var(--md-text-secondary);
}

/* Material Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.container-fluid {
  width: 100%;
  padding: 24px;
}

/* Material Grid */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: -8px;
}

.col {
  flex: 1;
  padding: 8px;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }

/* Material App Bar */
.app-bar {
  background: var(--md-primary);
  color: white;
  padding: 16px 24px;
  box-shadow: var(--md-shadow-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-bar h1 {
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.app-bar-actions {
  display: flex;
  gap: 8px;
}

/* Material Table */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--md-surface);
  box-shadow: var(--md-shadow-1);
  display: table;
  table-layout: auto;
}

.table-container {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
}

.table thead {
  background: #f5f5f5;
}

.table th {
  padding: 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--md-divider);
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--md-divider);
  color: var(--md-text-primary);
}

.table tbody tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Material Chip */
.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.08);
  color: var(--md-text-primary);
}

.chip-success {
  background: rgba(56, 142, 60, 0.12);
  color: var(--md-success);
}

.chip-error {
  background: rgba(211, 47, 47, 0.12);
  color: var(--md-error);
}

.chip-warning {
  background: rgba(245, 124, 0, 0.12);
  color: var(--md-warning);
}

.chip-primary {
  background: rgba(25, 118, 210, 0.12);
  color: var(--md-primary);
}

/* Material Snackbar */
.snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: white;
  padding: 14px 24px;
  border-radius: 4px;
  box-shadow: var(--md-shadow-3);
  z-index: 1000;
  display: none;
  animation: slideUp 0.3s;
}

.snackbar.show {
  display: block;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Material Progress */
.progress {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--md-primary);
  transition: width 0.3s;
}

/* Material Divider */
.divider {
  height: 1px;
  background: var(--md-divider);
  margin: 16px 0;
}

/* Material Paper */
.paper {
  background: var(--md-surface);
  border-radius: 4px;
  box-shadow: var(--md-shadow-1);
  padding: 24px;
}

/* Sidebar Layout */
.sidebar-layout {
  display: flex;
  height: 100vh;
  background: var(--md-background);
  position: relative;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background: var(--md-surface);
  box-shadow: var(--md-shadow-2);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--md-divider);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header img {
  height: 32px;
  width: auto;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 500;
  color: #000000;
  margin: 0;
}

.sidebar-menu {
  padding: 16px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  color: var(--md-text-primary);
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-menu-item.active {
  background: rgba(25, 118, 210, 0.08);
  color: var(--md-primary);
  border-left-color: var(--md-primary);
  font-weight: 500;
}

.sidebar-menu-item-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.sidebar-menu-item-text {
  flex: 1;
  font-size: 14px;
}

.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  background: var(--md-background);
  display: flex;
  flex-direction: column;
  width: calc(100% - 280px);
}

.main-content-header {
  background: var(--md-surface);
  padding: 16px 24px;
  box-shadow: var(--md-shadow-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.main-content-header h1 {
  font-size: 20px;
  font-weight: 500;
  color: #000000;
  margin: 0;
}

.main-content-body {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--md-divider);
  margin-top: auto;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.user-info-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--md-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 16px;
}

.user-info-details {
  flex: 1;
}

.user-info-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-text-primary);
}

.user-info-role {
  font-size: 12px;
  color: var(--md-text-secondary);
}

.logout-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--md-divider);
  color: var(--md-text-primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(211, 47, 47, 0.08);
  border-color: var(--md-error);
  color: var(--md-error);
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--md-text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .col-6, .col-4, .col-3 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .container {
    padding: 16px;
  }
  
  .card {
    padding: 16px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-toggle {
    display: block;
  }

  .main-content-body {
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
