/*================================================================
  DARBINE Professional UI/UX Redesign
  Author: Gemini AI
  Version: 2.0
  Approach: Mobile-First Responsive Design
================================================================*/

/* 1. THEME & VARIABLES */
:root {
  --primary-color: #FF9900;
  --primary-dark: #E68A00;
  --secondary-color: #34495e;
  --accent-color: #e74c3c;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  
  --text-color: #34495e;
  --text-muted: #6c757d;
  --heading-color: #2c3e50;
  
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --sidebar-bg: var(--primary-color);
  --border-color: #dee2e6;
  
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --border-radius: 12px;
  --font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* 2. BASE & RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* THE FIX IS HERE: Added smooth scrolling for the whole site */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

/* 3. CORE LAYOUT (MOBILE-FIRST) */
.layout {
  display: flex;
  flex: 1;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 260px;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.main-content {
  width: 100%;
  transition: margin-left 0.3s ease;
}

.topbar {
  background: var(--card-bg);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.content-wrapper {
  padding: 1.5rem;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.mobile-menu-btn {
  display: block;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-color);
}

#menu-toggle {
  display: none;
}

#menu-toggle:checked ~ .sidebar {
  transform: translateX(0);
}

@media (min-width: 992px) {
  .sidebar {
    transform: translateX(0);
    position: fixed;
  }
  .main-content {
    margin-left: 260px;
  }
  .mobile-menu-btn {
    display: none;
  }
  .content-wrapper {
    padding: 2rem;
  }
}

/* 4. REUSABLE COMPONENTS */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}
.btn-primary { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background-color: var(--secondary-color); color: #fff; border-color: var(--secondary-color); }
.btn-secondary:hover { background-color: #2c3e50; border-color: #2c3e50; }
.btn-danger { background-color: var(--danger-color); color: #fff; border-color: var(--danger-color); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-control, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: #fff;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.25);
}

.table-responsive { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: middle;
}
.table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.alert { padding: 1rem 1.25rem; margin-bottom: 1.5rem; border-radius: 8px; border: 1px solid transparent; }
.alert.success { background-color: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert.error { background-color: #fee2e2; color: #991b1b; border-color: #fecaca; }

.badge {
  display: inline-block;
  padding: 0.3em 0.6em;
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 1rem;
}
.status-published, .status-paid { background-color: #d1fae5; color: #065f46; }
.status-pending { background-color: #fef3c7; color: #92400e; }
.status-draft { background-color: #e5e7eb; color: #374151; }

/* 5. SPECIFIC COMPONENT STYLES */

.sidebar .logo { 
    flex-shrink: 0; 
    font-size: 1.7rem; 
    font-weight: bold; 
    padding: 1.5rem 0; 
    text-align: center; 
    background: rgba(0,0,0,0.1); 
}
.sidebar nav {
    flex-grow: 1; 
    overflow-y: auto; 
    margin-top: 1rem;
}
.sidebar .logout { 
    flex-shrink: 0; 
    padding: 1.5rem; 
}

.sidebar nav a { display: flex; align-items: center; gap: 1rem; color: #fff; text-decoration: none; padding: 0.9rem 1.5rem; border-left: 4px solid transparent; }
.sidebar nav a:hover { background: rgba(0,0,0,0.1); }
.sidebar nav a.active { background: rgba(0,0,0,0.2); border-left-color: #fff; font-weight: 600; }
.sidebar .logout a { display: block; text-align: center; background: #fff; color: var(--primary-color); padding: 0.75rem; border-radius: 8px; font-weight: bold; }

.metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.metric-card h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.metric-card .value { font-size: 2rem; font-weight: 700; }

.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* 6. CONTENT OVERFLOW & RESPONSIVENESS HELPERS */
img { max-width: 100%; height: auto; }
.table, .card { word-wrap: break-word; overflow-wrap: break-word; }