/* ---- GOOGLE FONTS ---- */
@import url('https://fonts.googleapis.com/css2?family=Exo:wght@300;400;500&family=Exo+2:wght@300;400;500&family=Material+Symbols+Outlined:wght@400&display=swap');

/* ---- RESET ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: "Exo", sans-serif;
  font-size: 14px;
  font-weight: 300;
  background: #f7f6fb;
  color: #222;
}

/* ---- TITLES ---- */
h1, h2, h3, h4, h5 {
  font-family: "Exo 2", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #4A148C;
}

/* ---- LINKS & BUTTONS ---- */
a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: "Exo", sans-serif;
  font-size: 14px;
  font-weight: 300;
  border: none;
  outline: none;
}

/* ---- TABLES ---- */
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
  font-size: 14px;
  font-weight: 300;
}

th {
  background: #fafafa;
  color: #4A148C;
  font-family: "Exo 2", sans-serif;
  font-weight: 400;
}

/* ---- LAYOUT ---- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 60px);
  overflow: hidden;
}

/* ---- HEADER ---- */
.header {
  width: 100%;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #e4e4e4;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between; /* logo left, menu right */
  width: 100%;
  height: 100%;
  padding: 0 0; /* هیچ فاصله‌ای از دو طرف */
}

/* ---- HEADER LEFT ---- */
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 20px; /* کمی فاصله از لبه چپ برای زیبایی */
}

.header-left img {
  height: 34px;
}

/* ---- TOP NAV ---- */
.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-right: 20px; /* کمی فاصله از لبه راست برای زیبایی */
}

.topnav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #444;
  font-size: 12px;
  font-weight: 400;
  transition: color 0.2s, border-bottom 0.2s;
}

.topnav a:hover,
.topnav a.active {
  color: #4A148C;
  border-bottom: 2px solid #4A148C;
  padding-bottom: 4px;
}

.topnav a.logout {
  color: #ff5252;
  font-weight: 500;
}

.topnav a.logout:hover {
  background: rgba(255, 82, 82, 0.1);
  color: #ff1744;
}

.topnav .material-symbols-outlined {
  vertical-align: middle;
  font-size: 20px;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: 220px;
  background: #2C0057;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 80px;
  min-height: 100vh;
}

/* Sidebar Links */
.sidebar a {
  color: #D8C9FF;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-family: "Exo", sans-serif;
  font-size: 13px;
  font-weight: 400;
  transition: background 0.2s, color 0.2s;
}

/* Google Icons */
.sidebar a .material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-size: 16px;
  color: #FFB20C;
  line-height: 1;
  vertical-align: middle;
  transition: color 0.2s;
}

/* Hover & Active states */
.sidebar a:hover,
.sidebar a.active {
  background: #6C2EDB;
  color: #fff;
}

.sidebar a:hover .material-symbols-outlined,
.sidebar a.active .material-symbols-outlined {
  color: #fff;
}

/* Sidebar Footer */
.sidebar .footer {
  padding: 15px;
  font-family: "Exo", sans-serif;
  font-size: 12px;
  text-align: center;
  color: #BFA8FF;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ---- MAIN ---- */
.main {
  flex: 1;
  padding: 80px 25px 25px;
  overflow-x: hidden;
  background: #f7f6fb;
}

/* ---- CARDS ---- */
.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h4 {
  margin-bottom: 10px;
}

.card .value {
  font-size: 1.4em;
  font-weight: 400;
  color: #222;
}

.card .muted {
  font-size: 0.85em;
  color: #777;
}

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
}

.badge.ok {
  background: #e8f9f0;
  color: #0a8c3a;
}

.badge.err {
  background: #ffe7e7;
  color: #c02121;
}

/* ---- PANEL ---- */
.panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.panel h3 {
  margin-bottom: 10px;
}

.code {
  background: #f5f5f7;
  padding: 14px;
  border-radius: 8px;
  font-family: monospace;
  color: #333;
  font-size: 13px;
  white-space: pre-wrap;
}

/* ---- SERVICE TABLE ---- */
.table-container {
  margin-top: 20px;
  overflow-x: auto;
}

#svcTable {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

#svcTable thead {
  background: #f0e9ff;
}

#svcTable tr:nth-child(even) {
  background: #faf8ff;
}

#svcTable tr:hover {
  background: #f3edff;
  transition: background 0.2s;
}

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 400;
  text-transform: capitalize;
  transition: all 0.2s;
}

.status.active {
  background: #e6f9ee;
  color: #108c4a;
}

.status.pending {
  background: #fff7e0;
  color: #c78a00;
}

.btn-view {
  background: #4A148C;
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  transition: background 0.2s;
}

.btn-view:hover {
  background: #6C2EDB;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 0;
    min-height: auto;
  }
  .main {
    padding: 90px 10px 20px;
  }
  .topnav {
    display: none;
  }
}
