/* Admin Dashboard: Professional, Modern Look (Velzon-Inspired) */
:root {
  --admin-bg: #f3f4f6; /* Soft Gray Background */
  --admin-card: #ffffff;
  --admin-border: #e2e8f0; /* Sharper Gray Border */
  --admin-primary: #4f46e5; /* Indigo 600 - More modern than basic blue */
  --admin-primary-dark: #4338ca;
  --admin-primary-light: #e0e7ff;
  --admin-text: #1f2937; /* Darker Text */
  --admin-text-light: #64748b; /* Soft Gray Text */
  --admin-sidebar-bg: #1e293b; /* Dark Navy Sidebar */
  --admin-sidebar-text: #e2e8f0;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body { background: var(--admin-bg); font-family: 'Inter', system-ui, -apple-system, sans-serif; color: var(--admin-text); line-height: 1.6; }

/* Layout: Flex for desktop, Column for mobile */
.admin-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar { width: 260px; background: var(--admin-sidebar-bg); padding: 24px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow: auto; transition: transform 0.3s ease; }
.admin-sidebar .brand { font-size: 1.5rem; font-weight: 800; color: #ffffff; margin-top: 0; margin-bottom: 2rem; display: block; }

/* Navigation Links */
.sidebar-links ul { list-style: none; padding: 0; margin: 0; }
.sidebar-links li { margin-bottom: 0.25rem; }
.sidebar-links a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--admin-sidebar-text); border-radius: 8px; font-weight: 500; transition: all 0.2s; }
.sidebar-links a:hover { background: rgba(255,255,255,0.05); color: #ffffff; }
.sidebar-links a.active { background: var(--admin-primary); color: #ffffff; font-weight: 600; }

/* Main Content Area */
.admin-content { flex: 1; padding: 2.5rem; }
.admin-header { margin-bottom: 2.5rem; }
.admin-title { margin: 0; font-size: 1.875rem; font-weight: 800; color: var(--admin-text); }

/* Cards Grid */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.admin-card { background: var(--admin-card); border: 1px solid var(--admin-border); border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); padding: 24px; transition: transform 0.2s; }
.admin-card:hover { transform: translateY(-4px); }
.admin-card .title { margin: 0; font-size: 0.875rem; color: var(--admin-text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.025em; }
.admin-card .value { font-size: 2.5rem; font-weight: 800; margin: 0.5rem 0 0 0; color: var(--admin-text); }

/* Panels/Tables */
.panel { background: #ffffff; border: 1px solid var(--admin-border); border-radius: 16px; padding: 24px; margin-top: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.panel h3 { margin-top: 0; margin-bottom: 1.5rem; font-size: 1.25rem; font-weight: 700; color: var(--admin-text); }

/* Table Responsiveness */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Ensure table doesn't get squished */
}

.table th, .table td {
  border-bottom: 1px solid var(--admin-border);
  padding: 16px;
  text-align: left;
  font-size: 0.95rem;
  white-space: nowrap; /* Prevent content from wrapping unexpectedly */
}

/* Specific column adjustments */
.table th:nth-child(2), .table td:nth-child(2) {
  min-width: 200px;
  white-space: normal; /* Allow filename/title to wrap if needed */
}

/* Buttons */
.btn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 600; font-size: 0.9rem; padding: 10px 20px; transition: all 0.2s; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--admin-primary); color: #ffffff; }
.btn-primary:hover { background: var(--admin-primary-dark); }
.btn-danger { background: #ef4444; color: #ffffff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; border-radius: 6px; }

/* Forms */
input[type="text"], input[type="file"], input[type="number"], select, textarea { display: block; width: 100%; padding: 12px 16px; border: 1px solid var(--admin-border); border-radius: 8px; font-size: 1rem; }
input:focus { outline: none; border-color: var(--admin-primary); ring: 2px solid var(--admin-primary-light); }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; }

/* Badges */
.badge { display: inline-flex; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* Responsive Adjustments */
@media (max-width: 991px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { position: fixed; left: 0; top: 60px; width: 100%; height: calc(100vh - 60px); transform: translateX(-100%); z-index: 100; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { padding: 1.5rem; margin-top: 60px; }
  .admin-grid { grid-template-columns: 1fr; }
}