/* ==========================================================================
   1. CORE DESKTOP FRAMEWORK (ALL ORIGINAL CODES PRESERVED)
   ========================================================================== */

/* VIEWPORT ACCORDION RESETS */
html, body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* CORE APP INTERFACE CONTAINER */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: var(--bg-main);
}

/* FIX HEIGHT APP PLATFORM HEADER */
.app-header {
  height: 70px;
  width: 100%;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--bg-main);
  z-index: 100;
  flex-shrink: 0;
  box-sizing: border-box;
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  height: 36px;
  width: auto;
}
.brand-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 24px;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

/* SCROLLABLE INNER WORKSPACE ENGINE */
.app-workspace {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-sec);
  display: flex;
  flex-direction: column;
}

/* DYNAMIC SPLIT HERO FRAMEWORK */
.hero-panel {
  padding: 60px 32px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
  box-sizing: border-box;
}

.hero-left {
  text-align: left;
}
.hero-left h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}
.hero-left h1 span {
  color: var(--primary);
}
.hero-left p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 620px;
}

/* HERO CONSOLE PANEL RIGHT side */
.hero-right-action {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.hero-right-action h3 {
  font-family: 'Inter', sans-serif;
  margin-bottom: 12px;
  font-size: 20px;
}

/* SERVICE DASHBOARD PLATFORM CONSOLE */
.console-section {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px 60px 32px;
  box-sizing: border-box;
}

.console-widget {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 500px;
  overflow: hidden;
}

/* SIDE BAR NAVIGATION FILTER */
.console-sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-sec);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.console-tab-btn {
  background: transparent;
  border: none;
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}
.console-tab-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}
.console-tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* CONTENT CONTAINER ACTIVE TAB GRID */
.console-content-view {
  padding: 32px;
  display: none;
}
.console-content-view.active {
  display: block;
}

.view-header-details {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}
.view-header-details h2 {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
}
.view-header-details p {
  font-size: 14px;
  color: var(--text-muted);
}

.dashboard-inner-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.console-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  background: var(--card-bg);
  transition: border-color 0.2s;
}
.console-card:hover {
  border-color: #cbd5e1;
}
.card-ico-frame {
  font-size: 24px;
  margin-bottom: 12px;
}
.card-title-text {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
}
.card-desc-text {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* CORE CONTROL FOOTER */
.app-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  box-sizing: border-box;
}

/* OVERLAY MODALS STYLES */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 460px;
  position: relative;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
}
.modal-box h2 {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-box p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-sec);
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-select, .modal-textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.modal-textarea { min-height: 90px; resize: vertical; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.contact-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid var(--border);
  background: var(--bg-sec);
  color: var(--text-main);
  transition: all 0.2s;
  box-sizing: border-box;
}
.contact-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* ==========================================================================
   2. FLAWLESS MOBILE OVERHAUL METHODOLOGY (MAX-WIDTH: 900px)
   ========================================================================== */
@media (max-width: 900px) {
  
  /* FORCE MOBILE SCREEN TO STRETCH INSTEAD OF SMASHING ELEMENTS */
  html, body {
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .app-shell {
    height: auto !important;
    min-height: 100vh;
  }

  .app-workspace {
    overflow: visible !important;
    height: auto !important;
  }

  /* 1. HEADER RE-ALIGNMENT */
  .app-header {
    height: auto !important;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px !important;
    gap: 16px;
  }
  
  .brand-zone {
    width: 100%;
    justify-content: center;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    gap: 10px 16px;
    flex-wrap: wrap;
  }

  .nav-links a {
    font-size: 14px;
    padding: 4px 8px;
  }

  /* 2. HERO GRID DECONSTRUCTION */
  .hero-panel {
    grid-template-columns: 1fr !important; /* Converts desktop rows into neat vertical modules */
    gap: 32px;
    padding: 32px 16px;
    text-align: center;
  }

  .hero-left {
    text-align: center;
  }

  .hero-left h1 {
    font-size: 30px !important;
    line-height: 1.2;
    letter-spacing: -1px;
  }

  .hero-left p {
    margin: 0 auto 24px auto;
    font-size: 15px;
  }

  .hero-right-action {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
  }

  /* 3. PLATFORM CONSOLE SYSTEM */
  .console-section {
    padding: 0 16px 48px 16px;
  }

  .console-widget {
    grid-template-columns: 1fr !important;
    min-height: auto;
  }

  /* TRANSFORMS SIDEBAR INTO A HORIZONTAL SWIPABLE CONTROL TRACK */
  .console-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row !important;
    overflow-x: auto !important;
    white-space: nowrap;
    padding: 12px 16px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .console-sidebar::-webkit-scrollbar {
    display: none; /* Keeps the interface incredibly clean and minimalist */
  }

  .console-tab-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* 4. PRODUCT CARD WRAPPERS */
  .console-content-view {
    padding: 24px 16px;
  }

  .view-header-details h2 {
    font-size: 18px;
  }

  .dashboard-inner-cards {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .console-card {
    padding: 20px;
  }

  /* 5. FOOTER RESPONSIVENESS */
  .app-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px 16px;
  }
}

/* ==========================================================================
   3. HYPER-NARROW SMARTPHONE FINETUNING (MAX-WIDTH: 400px)
   ========================================================================== */
@media (max-width: 400px) {
  .contact-grid {
    grid-template-columns: 1fr !important;
  }
}