/* =========================================
   License Manager • SmartNet
   SaaS Premium Glass UI – Dark
   ========================================= */

/* Reset / base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(129,140,248,0.22), transparent 55%),
    radial-gradient(circle at center, rgba(15,23,42,1), rgba(15,23,42,1));
  color: #e5e7eb;
  min-height: 100vh;
}

/* Κείμενα */
h1,h2,h3,h4,h5,h6 {
  font-weight: 600;
  margin: 0;
  color: #e5e7eb;
}

p {
  margin: 0;
}

/* LABELS – για φόρμες / popup */
label {
  display: block;
  margin-bottom: 2px;
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* Συνδέσμοι */
a {
  color: #93c5fd;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* =====================================================
   Layout γενικά (as-cards)
   ===================================================== */

body.as-cards {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Περιτύλιγμα περιεχομένου */
.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 72px auto 18px;
  padding: 0 14px 18px;
}

/* Top bar – Glass */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(148,163,184,0.30);
  background: linear-gradient(
                to bottom,
                rgba(15,23,42,0.92),
                rgba(15,23,42,0.85)
              );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(15,23,42,0.80);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.1rem;
  color: #e5e7eb;
}

.logo img {
  max-height: 32px;
  width: auto;
  display: block;
}

/* Ετικέτα χρήστη */
.topbar .user-label {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Δεξιά actions στο topbar */
.topbar .actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Κουμπιά γενικά */
button {
  font: inherit;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.5);
  background: radial-gradient(circle at top left, rgba(30,64,175,0.65), rgba(15,23,42,1));
  color: #e5e7eb;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.1s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
  box-shadow: 0 8px 20px rgba(15,23,42,0.6);
}

button:hover {
  background: radial-gradient(circle at top left, rgba(59,130,246,0.85), rgba(15,23,42,1));
  border-color: rgba(96,165,250,0.9);
  box-shadow: 0 12px 32px rgba(15,23,42,0.85);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(15,23,42,0.75);
}

/* Primary */
button.primary {
  background: radial-gradient(circle at top left, rgba(59,130,246,0.98), rgba(37,99,235,0.92));
  border-color: rgba(129,140,248,0.9);
  color: #eff6ff;
}
button.primary:hover {
  background: radial-gradient(circle at top left, rgba(96,165,250,1), rgba(37,99,235,1));
  border-color: rgba(191,219,254,1);
}

/* Μικρά κουμπιά (π.χ. ✏️ 🗑️) */
button.btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 999px;
  box-shadow: none;
}

/* Card / panel */
.card {
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.35);
  background:
    radial-gradient(circle at top left, rgba(30,64,175,0.25), transparent 55%),
    radial-gradient(circle at bottom right, rgba(15,23,42,0.95), rgba(15,23,42,0.98));
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow:
    0 18px 38px rgba(15,23,42,0.9),
    0 0 0 1px rgba(15,23,42,0.8) inset;
}

/* Κεφαλίδα κάρτας / πίνακα */
.table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.table-head .muted {
  font-size: 0.8rem;
}

/* Text helpers */
.muted {
  color: #9ca3af;
}

/* Πίνακες */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(30,64,175,0.55);
  background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.98));
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8rem;
}

thead {
  background: linear-gradient(to right, rgba(30,64,175,0.9), rgba(15,23,42,0.98));
}

thead th {
  text-align: left;
  padding: 7px 10px;
  font-weight: 500;
  color: #cbd5f5;
  white-space: nowrap;
  border-bottom: 1px solid rgba(30,64,175,0.8);
}

tbody td {
  padding: 7px 10px;
  border-top: 1px solid rgba(15,23,42,0.9);
  color: #e5e7eb;
}

tbody tr:nth-child(even) {
  background: rgba(15,23,42,0.8);
}
tbody tr:nth-child(odd) {
  background: rgba(15,23,42,0.95);
}

tbody tr:hover {
  background: radial-gradient(circle at left, rgba(37,99,235,0.38), rgba(15,23,42,0.98));
}

/* Hidden σε mobile */
.hide-mobile {
  display: table-cell;
}

/* Badges (Active / Expired / Inactive) */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid transparent;
}

.status-active {
  background: rgba(22,163,74,0.18);
  border-color: rgba(34,197,94,0.65);
  color: #bbf7d0;
}
.status-expired {
  background: rgba(220,38,38,0.24);
  border-color: rgba(248,113,113,0.85);
  color: #fee2e2;
}
.status-inactive {
  background: rgba(75,85,99,0.45);
  border-color: rgba(148,163,184,0.9);
  color: #e5e7eb;
}

/* Φίλτρα / search bar πάνω από tables */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
  align-items: center;
}

/* ΑΝΑΖΗΤΗΣΗ – ίδιο ύψος / εμφάνιση με όλα τα άλλα inputs */
.search {
  flex: 1 1 180px;
  min-width: 160px;
  height: 32px;
  border-radius: 6px;
}

/* =========================================
   INPUTS – σκούρα, όχι άσπρα
   ========================================= */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: linear-gradient(#1f2937, #111827);
  border-radius: 6px;
  border: 1px solid rgba(100,116,139,0.55);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.8rem;
  color: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: #6b7280;
}

/* Focus: ίδια εικόνα με before */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(147,197,253,0.95);
  background: linear-gradient(#1f2937, #111827);
  outline: none;
}

/* DROPDOWN – σκούρο και μέσα */
select {
  background: linear-gradient(#1f2937, #111827);
  color: #e5e7eb;
}

select option {
  background-color: #111827;
  color: #e5e7eb;
}

/* 🔥 ΕΞΤΡΑ: ΓΙΑ ΝΑ ΜΗΝ ΑΣΠΡΙΖΕΙ ΠΟΤΕ ΤΟ SEARCH */
.search input,
input.search,
#search {
  background: linear-gradient(#1f2937, #111827) !important;
  border: 1px solid rgba(100,116,139,0.55) !important;
  color: #e5e7eb !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Checkboxes */
label.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #e5e7eb;
}

label.check input[type="checkbox"] {
  width: auto;
}

/* Δίστηλη διάταξη φορμών */
.grid2 {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px 12px;
}

/* Footer μικρό */
.note {
  font-size: 0.78rem;
}

/* Alerts */
.alert {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
}
.alert.success {
  border: 1px solid rgba(34,197,94,0.7);
  background: rgba(22,163,74,0.24);
  color: #bbf7d0;
}
.alert.error {
  border: 1px solid rgba(248,113,113,0.85);
  background: rgba(127,29,29,0.7);
  color: #fee2e2;
}

/* =========================================
   Dialogs (π.χ. άδεια, χρήστες)
   ========================================= */

dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: radial-gradient(circle at top, rgba(15,23,42,0.85), rgba(15,23,42,0.95));
  backdrop-filter: blur(6px);
}

/* Εσωτερικό sheet του dialog */
dialog .sheet {
  min-width: min(520px, 94vw);
  margin: 0;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.7);
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.32), transparent 55%),
    radial-gradient(circle at bottom right, rgba(15,23,42,0.98), rgba(15,23,42,1));
  padding: 14px 16px 12px;
  box-shadow:
    0 24px 60px rgba(15,23,42,0.9),
    0 0 0 1px rgba(15,23,42,0.85) inset;
}

dialog .sheet h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

/* Κάτω κουμπιά dialog */
dialog menu {
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

dialog menu button {
  min-width: 92px;
}

/* =========================================
   Login page
   ========================================= */

body.login-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.15), transparent 55%),
    radial-gradient(circle at bottom right, rgba(129,140,248,0.18), transparent 55%),
    radial-gradient(circle at center, rgba(15,23,42,1), rgba(15,23,42,1));
  color: #e5e7eb;
}

body.login-page main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 52px;
}

/* Κεντρική κάρτα login */
.login-card {
  max-width: 420px;
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.50);
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.42), transparent 55%),
    radial-gradient(circle at bottom right, rgba(15,23,42,0.98), rgba(15,23,42,1));
  box-shadow:
    0 24px 60px rgba(15,23,42,0.95),
    0 0 0 1px rgba(15,23,42,0.85) inset;
  padding: 24px 20px 18px;
}

/* Τίτλοι στο login */
.login-title {
  font-size: 1.4rem;
  margin: 0;
  color: #e5e7eb;
}
login-sub {
  font-size: 0.85rem;
  margin-top: 4px;
  color: #9ca3af;
}

/* Input στο login (λίγο πιο μεγάλο) */
.login-input {
  height: 44px;
  font-size: 0.9rem;
}

/* Μπάρα κάτω στο login (αν την χρησιμοποιείς) */
.login-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15,23,42,0.95);
  border-top: 1px solid rgba(30,64,175,0.65);
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 50;
}

/* Μήνυμα λάθους στο login */
.error {
  font-size: 0.8rem;
  color: #fecaca;
}

/* =========================================
   Settings / logos
   ========================================= */

.settings-logo-preview img {
  max-height: 60px;
  width: auto;
  border-radius: 8px;
  border: 1px solid rgba(31,41,55,0.95);
  padding: 4px;
  background: rgba(15,23,42,0.98);
}

/* =========================================
   Responsiveness
   ========================================= */

@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }

  .wrap {
    margin-top: 76px;
    padding: 0 10px 12px;
  }

  .hide-mobile {
    display: none;
  }

  .metrics-grid {
    gap: 8px;
  }

  .card {
    padding: 10px 10px;
  }

  dialog .sheet {
    min-width: 94vw;
    padding: 12px 12px 10px;
  }

  .grid2 {
    grid-template-columns: minmax(0,1fr);
  }
}
