/* ------------------------------------------------------------------
   🌐 Google Font: Inter - clean and readable for interfaces
------------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* ------------------------------------------------------------------
   🎨 Theme Variables (Light Mode by Default)
------------------------------------------------------------------ */
:root {
  --primary-color: #2F80ED;
  --hover-color: #1C64F2;
  --success-color: #10B981;
  --bg-color: #F5F7FA;
  --text-color: #374151;
  --border-color: #E5E7EB;
  --card-bg: white;
}

/* ------------------------------------------------------------------
   🌙 Dark Mode Overrides (Applied via .dark-mode class on <body>)
------------------------------------------------------------------ */
body.dark-mode {
  --primary-color: #4F9EF9;
  --hover-color: #357CF5;
  --success-color: #34D399;
  --bg-color: #1E293B;
  --text-color: #F3F4F6;
  --border-color: #334155;
  --card-bg: #273549;
}

/* ------------------------------------------------------------------
   🧱 General Page Styling
------------------------------------------------------------------ */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* ------------------------------------------------------------------
   📁 Sidebar Styling
------------------------------------------------------------------ */
.sidebar {
  width: 250px;
  height: 100vh;
  background: #343a40;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
}

.sidebar.hidden {
  transform: translateX(-100%);
}

.sidebar h3 {
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar ul li {
  border-bottom: 1px solid #444;
}

.sidebar ul li a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 12px;
  transition: background 0.3s ease;
}

.sidebar ul li a:hover {
  background: #495057;
}

/* ------------------------------------------------------------------
   🧾 Main Content Wrapper (with left margin for sidebar)
------------------------------------------------------------------ */
.content {
  margin-left: 270px;
  padding: 20px;
  width: calc(100% - 270px);
  box-sizing: border-box;
}

/* ------------------------------------------------------------------
   🧾 Table Container Styling
------------------------------------------------------------------ */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}

/* ------------------------------------------------------------------
   📊 Modern Table Styling
------------------------------------------------------------------ */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s ease;
}

/* ------------------------------------------------------------------
   🧾 Cards for Summary or Section Boxes
------------------------------------------------------------------ */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.card h4 {
  margin-top: 0;
  font-size: 1.25rem;
}

/* ------------------------------------------------------------------
   🧾 Form Layout and Inputs
------------------------------------------------------------------ */
form {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 1200px;
  margin: auto;
}

.form-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group .input-container {
  flex: 1;
  min-width: 250px;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #1e293b;
  color: var(--text-color);
  border-color: var(--border-color);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.2);
}

/* ------------------------------------------------------------------
   🧾 Button Styles (Primary, Danger, etc.)
------------------------------------------------------------------ */
button, .btn {
  background: var(--primary-color);
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease-in-out;
}

button:hover, .btn:hover {
  background: var(--hover-color);
  opacity: 0.95;
}

.btn-danger {
  background: #dc3545;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-primary {
  background: var(--primary-color);
}

.btn-primary:hover {
  background: var(--hover-color);
}

/* ------------------------------------------------------------------
   📱 Responsive Design for Tablets & Phones
------------------------------------------------------------------ */
@media screen and (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.visible {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
    width: 100%;
    padding: 15px;
  }

  .table-container {
    overflow-x: scroll;
  }

  table {
    min-width: 600px;
  }

  .form-group {
    flex-direction: column;
  }
}
