
/* ============================================================
   MIME DASHBOARD CSS
   Structure:
     1. Base       — always applies
     2. Desktop    — min-width: 981px overrides
     3. Mobile     — max-width: 980px overrides
   ============================================================ */


/* ── 1. BASE ─────────────────────────────────────────────── */

.mime-dashboard-header {
  width: 100%;
  background-color: #c0dbf1;
  padding: 25px 20px;
  border-bottom: 2px solid black;
  text-align: center;
}

.mime-dashboard-header h2 {
  margin: 0;
  padding: 0;
  font-size: 1.5rem;
  font-weight: bold;
}

.mime-dashboard {
  display: flex;
  flex-wrap: nowrap;
  margin: 0 auto;
  background-color: #e9f3fb;
  flex: 1 1 auto;
  border-radius: 10px;
  max-width: 100%;
}

.mime-dashboard-sidebar {
  background-color: #d2e7f8;
  border-right: 1px solid black;
  padding: 10px 0;
  flex: 0 0 auto;
  min-width: 160px;
  display: flex;
  flex-direction: column;
}

.mime-tab-link {
  display: block;
/*  width: 100%;*/
  padding: 10px 16px;
  text-align: left;
  font-weight: bold;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
  color: black;
}
/* slide the logout to the bottom * /
.mime-tab-link.mime-tab-link-logout {
  margin-top: auto;
}
*/
.mime-tab-link:hover,
.mime-tab-link.active {
  background-color: #c0dbf1;
}

.mime-dashboard-content {
  padding: 20px 0;
  box-sizing: border-box;
  flex: 1;
  max-width: 100%;
  min-width: 0;
  max-height: 440px;
  overflow-y: auto;
}

.mime-tab-panel {
  display: none;
  height: 100%;
}

.mime-tab-panel.visible {
  display: block;
}

/* ---------- Tables (base) --------------------------------- */

.mime-element-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mime-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.mime-table th,
.mime-table td {
  border: 1px solid #ccc;
  padding: 0.5em;
  text-align: left;
}

.mime-table th {
  background-color: #d2e7f8;
}

.membership-active {
  background-color: #eaffea;
}

.membership-expired {
  background-color: #ffeeee;
  opacity: 0.6;
}

.mime-table-action {
  font-size: 0.85em;
  line-height: 1.4;
  margin-bottom: 0.2em;
}

.mime-table-action:last-child {
  margin-bottom: 0;
}

.mime-table-action a,
.mime-table-action button {  /* make buttons look like a link */
  color: #0073aa;
  text-decoration: none;
  font-size: 0.9em;
  padding: 0;
  border: 0;
  background-color: transparent;
}

.mime-table-action a:hover,
.mime-table-action button:hover {
  text-decoration: underline;
}

.mime-status-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.mime-status-label {
  white-space: nowrap;
  padding-top: 0.15em;
}

.mime-action-links {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

/* ---------- Login Tab (base) ------------------------------ */

.password-wrapper {
  position: relative;
  display: inline-block;
}

.password-wrapper input {
  padding-right: 2.5em;
}

.toggle-password {
  position: absolute;
  top: 50%;
  transform: translateY(-80%);
  cursor: pointer;
  width: 1.5em;
  height: 1.5em;
  background: transparent;
  border: none;
}

.toggle-password::before {
  content: '👁️';
  font-size: 1.2em;
  color: #666;
}

.toggle-password.showing::before {
  content: '🙈';
}


/* ── 2. DESKTOP (>= 981px) ───────────────────────────────── */

@media (min-width: 981px) {

  .mime-dashboard {
    min-height: 440px;  /* only meaningful with side-by-side layout */
  }

  .mime-table {
    min-width: 650px;   /* allow table to breathe on wide screens */
  }

}


/* ── 3. MOBILE (<= 980px) ────────────────────────────────── */

@media (max-width: 980px) {

  /* Sidebar stacks above content */
  .mime-dashboard {
    flex-wrap: wrap;
  }

  .mime-dashboard-sidebar {
    width: 100%;
    flex-direction: row;  /* nav items run horizontally on mobile */
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid black;
  }

  .mime-tab-link.mime-tab-link-logout {
    margin-top: 0;      /* reset desktop push-to-bottom */
    margin-left: auto;  /* push logout to the right end of the row */
  }

  .mime-dashboard-content {
    min-width: auto;
    padding: 0;
  }

  .mime-form {
    padding: 0 10px;
  }

  /* Table: disable horizontal scroll, use card layout instead */
  .mime-element-table {
    overflow-x: visible;
  }

  .mime-table,
  .mime-table thead,
  .mime-table tbody,
  .mime-table tr,
  .mime-table th,
  .mime-table td {
    display: block;
  }

  /* Hide column headers — data-label takes over */
  .mime-table thead {
    display: none;
  }

  /* Each row becomes a card */
  .mime-table tbody tr {
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    background-color: white;
  }

  /* Each cell: label on left, value on right */
  .mime-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
/*    border-bottom: 1px solid #e8e8e8; */
    padding: 0.5em 0.75em;
  }

  .mime-table td:last-child {
    border-bottom: none;
  }

  /* Inject column label from data-label attribute */
  .mime-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #1a5f8a;
    flex-shrink: 0;
    margin-right: 1rem;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

	.mime-table .mime-status-actions {
		flex-direction: column;
		align-items: flex-end;
		width: 100%;
/*		justify-content: flex-end; */
	}

  /* Actions cell inner layout * /
  .mime-table .mime-status-actions {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  /* Action buttons side by side */
  .mime-table .mime-action-links {
    flex-direction: row;
    gap: 1em;
    margin-top: 0.3em;
  }

}
