/* RAdmin Panel Style Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a1a;
  color: #ffffff;
}

/* Header */
.cpanel-header {
  background: #20a53a;
  color: white;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-left .logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.header-left .logo i {
  margin-right: 10px;
  font-size: 1.8rem;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  margin-right: 15px;
  cursor: pointer;
  padding: 5px;
}

@media (max-width: 480px) {
  .sidebar-toggle {
    display: block;
  }
}

.header-right .user-menu {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.header-right .user-menu i {
  margin-right: 8px;
  font-size: 1.2rem;
}

/* Layout Container */
.cpanel-layout {
  display: flex;
  min-height: calc(100vh - 50px);
}

/* Left Sidebar Navigation */
.cpanel-sidebar {
  width: 220px;
  background: #2d2d2d;
  border-right: 1px solid #404040;
  padding: 10px 0;
  position: fixed;
  top: 50px;
  left: 0;
  height: calc(100vh - 50px);
  overflow-y: auto;
  z-index: 100;
}

.nav-item {
  margin: 2px 0;
}

.nav-item a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  text-decoration: none;
  color: #cccccc;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}

.nav-item a:hover {
  color: #20a53a;
  background: #404040;
  border-left-color: #20a53a;
}

.nav-item.active a {
  color: #20a53a;
  background: #404040;
  border-left-color: #20a53a;
}

.nav-item i {
  font-size: 1.2rem;
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

.nav-item span {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Main Content */
.cpanel-content {
  flex: 1;
  margin-left: 220px;
  padding: 20px;
  min-height: calc(100vh - 50px);
  background: #1a1a1a;
}

/* RAdmin Cards */
.cpanel-card {
  background: #2d2d2d;
  border-radius: 6px;
  border: 1px solid #404040;
  margin-bottom: 20px;
  overflow: hidden;
}

.cpanel-card-header {
  background: #404040;
  padding: 12px 20px;
  border-bottom: 1px solid #555;
  font-weight: 500;
  color: #ffffff;
  font-size: 0.9rem;
}

.cpanel-card-body {
  padding: 20px;
  background: #2d2d2d;
}

/* Buttons */
.cpanel-btn,
.button {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 2px;
}

.cpanel-btn i {
  margin-right: 6px;
}

.cpanel-btn-primary {
  background: #20a53a;
  color: white;
}

.cpanel-btn-primary:hover {
  background: #1a8f32;
  color: white;
}

.cpanel-btn-success {
  background: #28a745;
  color: white;
}

.cpanel-btn-success:hover {
  background: #218838;
  color: white;
}

.cpanel-btn-warning {
  background: #ffc107;
  color: #212529;
}

.cpanel-btn-warning:hover {
  background: #e0a800;
}

.cpanel-btn-danger {
  background: #dc3545;
  color: white;
}

.cpanel-btn-danger:hover {
  background: #c82333;
  color: white;
}

.cpanel-btn-info {
  background: #17a2b8;
  color: white;
}

.cpanel-btn-info:hover {
  background: #138496;
  color: white;
}

.cpanel-btn-secondary {
  background: #6c757d;
  color: white;
}

.cpanel-btn-secondary:hover {
  background: #5a6268;
  color: white;
}

.cpanel-btn-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
}

/* Tables */
.cpanel-table,
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.cpanel-table th,
.cpanel-table td,
.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #404040;
  color: #cccccc;
}

.cpanel-table th,
.table th {
  background: #404040;
  font-weight: 500;
  color: #ffffff;
  font-size: 0.85rem;
}

.cpanel-table tr:hover,
.table tr:hover {
  background: #404040;
}

/* Override Metro UI table styles for dark theme */
.table.striped tbody tr:nth-child(odd) {
  background: #333333;
}

.table.striped tbody tr:nth-child(even) {
  background: #2d2d2d;
}

.table tbody tr {
  color: #cccccc;
}

.table tbody td {
  color: #cccccc !important;
}

/* Status badges */
.cpanel-badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 12px;
  text-transform: uppercase;
}

.cpanel-badge-success {
  background: #d4edda;
  color: #155724;
}

.cpanel-badge-warning {
  background: #fff3cd;
  color: #856404;
}

.cpanel-badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.cpanel-badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

/* Grid system */
.cpanel-row {
  display: flex;
  flex-wrap: wrap;
  margin: -10px;
}

.cpanel-col {
  flex: 1;
  padding: 10px;
}

.cpanel-col-2 {
  flex: 0 0 50%;
  padding: 10px;
}

.cpanel-col-3 {
  flex: 0 0 33.333%;
  padding: 10px;
}

.cpanel-col-4 {
  flex: 0 0 25%;
  padding: 10px;
}

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

.cpanel-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #cccccc;
}

.cpanel-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #404040;
  color: #ffffff;
}

.cpanel-input:focus {
  outline: none;
  border-color: #20a53a;
  box-shadow: 0 0 0 2px rgba(32, 165, 58, 0.2);
}

.cpanel-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #404040;
  color: #ffffff;
}

/* Modal */
.cpanel-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
}

.cpanel-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.cpanel-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #2d2d2d;
  border-radius: 6px;
  border: 1px solid #555;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  width: 90%;
  max-width: 500px;
}

.cpanel-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #555;
  background: #404040;
  border-radius: 6px 6px 0 0;
}

.cpanel-modal-header h5 {
  margin: 0;
  font-weight: 500;
  color: #ffffff;
}

.cpanel-modal-header button {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #cccccc;
  cursor: pointer;
  padding: 5px;
}

.cpanel-modal-body {
  padding: 20px;
  background: #2d2d2d;
}

.cpanel-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #555;
  background: #404040;
  border-radius: 0 0 6px 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .cpanel-sidebar {
    width: 60px;
  }
  
  .cpanel-sidebar .nav-item span {
    display: none;
  }
  
  .cpanel-sidebar .nav-item a {
    padding: 15px 20px;
    justify-content: center;
  }
  
  .cpanel-sidebar .nav-item i {
    margin-right: 0;
  }
  
  .cpanel-content {
    margin-left: 60px;
    padding: 15px;
  }
  
  .cpanel-col-2,
  .cpanel-col-3,
  .cpanel-col-4 {
    flex: 0 0 100%;
  }
  
  .cpanel-modal-content {
    width: 95%;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  .cpanel-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .cpanel-sidebar.show {
    transform: translateX(0);
  }
  
  .cpanel-content {
    margin-left: 0;
  }
}