:root {
  --bg-body: #eef2f7;
  --bg-sidebar: #f3f4f6;
  --bg-card: #ffffff;
  --bg-card-soft: #f9fafb;
  --border-subtle: #e5e7eb;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.06);
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.08);
  --primary-strong: #1d4ed8;
  --accent: #16a34a;
  --accent-soft: rgba(22, 163, 74, 0.10);
  --danger: #ef4444;
  --warning: #eab308;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

/* Reset & base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #ffffff 0, #eef2f7 50%, #e5e7eb 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #f9fafb 0%, #eef2f7 100%);
  border-right: 1px solid var(--border-subtle);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  box-shadow: 6px 0 18px rgba(15, 23, 42, 0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  margin-right: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 2px #e5e7eb;
}

.logo-icon {
  font-size: 1.7rem;
  margin-right: 10px;
}

.logo-text-main {
  font-weight: 600;
  font-size: 1.0rem;
  letter-spacing: .01em;
  color: #111827;
}

.logo-text-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sidebar-nav {
  margin-top: 8px;
}

.sidebar-nav h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition:
    background .18s ease-out,
    color .18s ease-out,
    border-color .18s ease-out,
    transform .08s ease-out;
}

.sidebar-nav a:hover {
  background: var(--primary-soft);
  color: #111827;
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.sidebar-nav a.active {
  background: #ffffff;
  color: #111827;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

/* Main */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 12px 22px;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.topbar h1 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #111827;
}

.topbar-user {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.content {
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto 32px;
}

/* Cards & grids */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #111827;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.stat-card h3 {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

/* Forms */
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 0.9rem;
  outline: none;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    transform .08s ease-out;
}

input[type="file"] {
  padding: 8px 11px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-soft);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.9);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.75), 0 0 0 4px rgba(191, 219, 254, 0.9);
  background: #ffffff;
  transform: translateY(-0.5px);
}

textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.4;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
}

th,
td {
  padding: 9px 11px;
  text-align: left;
}

th {
  background: #f3f4f6;
  color: #111827;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

tbody tr:nth-child(odd) {
  background: #ffffff;
}

tbody tr:hover {
  background: #e5f0ff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  gap: 6px;
  transition:
    background .18s ease-out,
    color .18s ease-out,
    box-shadow .18s ease-out,
    transform .08s ease-out,
    border-color .18s ease-out;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 50%);
  color: #f9fafb;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
}

.btn-secondary:hover {
  background: #f3f4f6;
}

.btn-google {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  box-shadow: 0 10px 26px rgba(15,23,42,0.08);
}

.btn-google:hover {
  box-shadow: 0 14px 32px rgba(15,23,42,0.12);
}

/* Signature */
.signature-wrapper {
  margin-top: 10px;
}

.signature-pad {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  border: 1px dashed #9ca3af;
  background: #f9fafb;
}

/* Footer */
.footer {
  padding: 10px 22px;
  font-size: 0.78rem;
  color: var(--text-soft);
  text-align: right;
  border-top: 1px solid var(--border-subtle);
  background: #f9fafb;
}

/* Auth pages */
.auth-container {
  max-width: 420px;
  margin: 40px auto;
}

.auth-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.auth-card h1 {
  margin-bottom: 6px;
  font-size: 1.4rem;
  color: #111827;
}

.auth-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.auth-card .actions {
  margin-top: 12px;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.gallery-item {
  background: var(--bg-card-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 10px;
  font-size: 0.8rem;
  border: 1px solid var(--border-subtle);
}

.gallery-item img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .sidebar-nav a {
    display: inline-flex;
    margin-right: 6px;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .content {
    padding: 16px;
  }

  .auth-card {
    border-radius: 18px;
  }
}
