/* ==========================================================
   INVIS.IT SITE FRAMEWORK – 2025
   Frosted Glass + Seamless Drift Edition + CRM Tabs
   ========================================================== */

/* ===== VARIABLES ===== */
:root {
  --color-primary: #0078d7;
  --color-primary-dark: #005fa3;
  --color-accent: #40c9ff;

  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-danger:  #dc3545;

  --color-text: #0a1a2f;
  --color-muted: rgba(255, 255, 255, 0.75);
  --color-border: rgba(255, 255, 255, 0.25);
  --color-glass: rgba(255, 255, 255, 0.12);
  --color-bg: rgba(0, 0, 0, 0.55);
  --color-bg-alt: rgba(0, 0, 0, 0.3);

  --shadow-default: 0 8px 25px rgba(0, 0, 0, 0.25);
  --shadow-hover:   0 12px 35px rgba(0, 0, 0, 0.45);

  --font-body: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-head: 'Segoe UI Semibold', 'Segoe UI', Roboto, sans-serif;

  --radius-default: 10px;
  --radius-card: 20px;

  --transition-fast: .25s ease;
  --transition-medium: .4s ease;
}

/* ===== DARK THEME ===== */
[data-theme='dark'] {
  --color-text: #f5f5f5;
  --color-muted: rgba(255, 255, 255, 0.7);
  --color-border: rgba(255, 255, 255, 0.2);
  --color-glass: rgba(255, 255, 255, 0.12);
  --color-bg: rgba(20, 22, 28, 0.8);
  --color-bg-alt: rgba(32, 34, 40, 0.5);
}

/* ==========================================================
   SEAMLESS INFINITE BACKGROUND DRIFT
   ========================================================== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('https://vc.invis-it.com/bg.jpeg') repeat;
  background-size: cover;
  animation: background-scroll 120s linear infinite;
  z-index: -1;
  transform: translateZ(0);
  will-change: background-position;
}

@keyframes background-scroll {
  from { background-position: 0 0; }
  to   { background-position: -3840px -2160px; }
}

/* ==========================================================
   GLOBAL BASE
   ========================================================== */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text);
  overflow-x: hidden;
  background: none;
  transition: color var(--transition-medium);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  margin: 0 0 1rem;
  font-weight: 600;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

p {
  line-height: 1.6;
  margin: 0 0 1rem;
}

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

/* ==========================================================
   CRM GRID FRAMEWORK
   ========================================================== */
.grid-layout {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr;
  gap: 25px;
  padding: 25px;
  width: 95%;
  height: 95vh;
  margin: auto;
  box-sizing: border-box;
}

.grid-placeholder {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* ==========================================================
   GLASS CARDS
   ========================================================== */
.glass-card {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 20px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.2);
  overflow: auto;
  transition: all 0.3s ease;
  color: #f5f5f5;
}
.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 45px rgba(0,0,0,0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-header h2 {
  margin: 0;
  font-size: 1.3em;
  color: #a0d8ff;
}

.card-header-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}
.card-header-sub h3 { margin: 0; color: #a0d8ff; }

/* ==========================================================
   TABLES
   ========================================================== */
.table-style {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.table-style th, .table-style td {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 8px 10px;
  text-align: left;
}
.table-style th {
  color: #40c9ff;
  font-weight: 500;
}
.table-style tr:hover {
  background: rgba(255,255,255,0.08);
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.button {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(0, 136, 255, 0.8);
  border: none;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.button:hover {
  background: rgba(0, 136, 255, 1);
  transform: scale(1.05);
}
.button.small {
  font-size: 0.85em;
  padding: 5px 12px;
  background: rgba(0, 122, 255, 0.6);
}
.button.small:hover {
  background: rgba(0, 122, 255, 0.8);
}
.button.danger {
  background: rgba(255, 64, 64, 0.6);
}
.button.danger:hover {
  background: rgba(255, 64, 64, 0.8);
}

/* ==========================================================
   INLINE FORMS
   ========================================================== */
.form-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.form-inline input,
.form-inline select {
  flex: 1;
  min-width: 100px;
  border-radius: 6px;
  border: none;
  padding: 6px 8px;
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.form-inline input::placeholder {
  color: rgba(255,255,255,0.6);
}

/* ==========================================================
   TABS
   ========================================================== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 15px;
  padding-bottom: 8px;
}
.tab {
  padding: 8px 14px;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  text-decoration: none;
  transition: all 0.25s ease;
}
.tab:hover {
  background: rgba(255,255,255,0.18);
}
.tab.active {
  background: rgba(0, 122, 255, 0.6);
  border-color: rgba(0, 122, 255, 0.8);
}
.tab-content {
  margin-top: 10px;
}
.pane {
  animation: fadeIn 0.25s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   RIGHT PANEL & LISTS
   ========================================================== */
.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.simple-list li {
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

/* ==========================================================
   SCROLLBARS
   ========================================================== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255,255,255,0.5);
}
/* ==========================================================
   FLOATING "BACK TO TOP" BUTTON
   ========================================================== */
.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 46px;
  height: 46px;
  background: rgba(0, 122, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  text-align: center;
  line-height: 46px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 999;
}
.back-to-top:hover {
  background: rgba(0, 122, 255, 0.9);
  transform: scale(1.1);
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  overflow: hidden;
}

.info-table th, .info-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.info-table th {
  text-align: left;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 3px solid #aaa;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: 80%;
  max-height: 85%;
  overflow-y: auto;
  padding: 20px;
  background: rgba(20, 20, 25, 0.9);
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 20px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}
.info-table th, .info-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.info-table th { background: rgba(255,255,255,0.1); text-align: left; }

h4 { margin-top: 10px; font-size: 1em; color: #7cd5ff; }

.loading { display: flex; align-items: center; gap: 10px; }
.spinner {
  width: 16px; height: 16px;
  border: 3px solid #aaa;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: #999; font-style: italic; }
