:root {
  --bg-dark: #0a0d14;
  --bg-surface: #111622;
  --bg-card: #161d2b;
  --bg-card-hover: #1e273a;
  --border: #232d42;
  --border-focus: #00d2ff;
  --primary: #00d2ff;
  --primary-hover: #0ea5e9;
  --primary-glow: rgba(0, 210, 255, 0.3);
  --accent: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Montserrat', var(--font-sans);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

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

/* NAVBAR */
.navbar {
  background: rgba(17, 22, 34, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
}
.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 900;
  background: linear-gradient(135deg, #00d2ff, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: #cbd5e1;
}
.btn-secondary:hover { background: var(--bg-card-hover); color: #fff; }
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.btn-danger:hover { background: #ef4444; color: #fff; }

/* CONTAINER & LAYOUT */
.main-wrapper { flex: 1; max-width: 1240px; margin: 0 auto; width: 100%; padding: 32px 24px; }

/* HERO SECTION */
.hero {
  padding: 48px 0 36px 0;
  text-align: center;
  position: relative;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.25);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 18px;
  color: #fff;
  letter-spacing: -1px;
}
.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 28px auto;
}

/* SECTION TITLES */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* CARDS GRID */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* APP CARD */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.app-card:hover {
  transform: translateY(-3px);
  border-color: #38bdf8;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}
.app-card-top { display: flex; align-items: flex-start; gap: 16px; }
.app-icon {
  width: 52px;
  height: 52px;
  background: #111622;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.app-category {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.app-name { font-size: 18px; font-weight: 800; color: #fff; margin: 2px 0 6px 0; }
.app-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* BLOG POST CARD */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}
.post-card:hover { transform: translateY(-3px); border-color: #3b82f6; }
.post-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #111622;
}
.post-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.post-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-amber);
}
.post-title { font-size: 17px; font-weight: 800; color: #fff; line-height: 1.35; }
.post-title a { color: #fff; }
.post-title a:hover { color: var(--primary); }
.post-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid #1a2333;
  padding-top: 12px;
}

/* FOOTER */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: auto;
}

/* DATA TABLES & ADMIN */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 65px);
}
.admin-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: var(--bg-card);
  color: #fff;
}
.admin-nav-item.active {
  color: var(--primary);
  border-left: 3px solid var(--primary);
}
.admin-content { padding: 32px; flex: 1; overflow-y: auto; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.stat-val { font-size: 28px; font-weight: 900; color: #fff; font-family: var(--font-heading); margin-top: 4px; }
.stat-lbl { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
table.data-table th {
  background: #111622;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
table.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid #1a2333;
  color: #cbd5e1;
}
table.data-table tr:hover td { background: var(--bg-card-hover); }

/* FORMS */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 700; color: #cbd5e1; }
.form-input {
  width: 100%;
  background: #0d111a;
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.form-input:focus { border-color: var(--primary); }

.badge {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* MODALS */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
