﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

    html,
    body {
      font-size: 13.5px !important;
    }

    .form-control-lg,
    .form-select-lg,
    .btn-lg {
      font-size: 13.5px !important;
      padding: 10px 16px !important;
    }

    body {
      font-family: 'Inter', sans-serif;
      color: #1e293b;
      font-weight: 500;
      background: linear-gradient(-45deg, #a1c4fd, #c2e9fb, #fbc2eb, #a6c1ee);
      background-size: 400% 400%;
      animation: gradientBG 15s ease infinite;
      background-attachment: fixed;
      min-height: 100vh;
    }

    @keyframes gradientBG {
      0% {
        background-position: 0% 50%;
      }

      50% {
        background-position: 100% 50%;
      }

      100% {
        background-position: 0% 50%;
      }
    }

    /* Safely enhance contrast for headings without breaking buttons/badges */
    .card h1,
    .card h2,
    .card h3,
    .card h4,
    .card h5,
    .card h6,
    .modal-content h1,
    .modal-content h2,
    .modal-content h3,
    .modal-content h4,
    .modal-content h5,
    .modal-content h6,
    .text-gradient {
      color: #0f172a;
      text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
    }

    .text-muted {
      color: #475569 !important;
      font-weight: 500;
    }

    .small {
      font-weight: 500;
    }

    .app-container {
      display: flex;
      min-height: 100vh;
    }

    .sidebar {
      width: 260px;
      background: rgba(255, 255, 255, 0.4);
      backdrop-filter: blur(24px) saturate(150%);
      -webkit-backdrop-filter: blur(24px) saturate(150%);
      border-right: 1px solid rgba(255, 255, 255, 0.7);
      color: #1e293b;
      transition: 0.3s;
      z-index: 1040;
      position: fixed;
      height: 100vh;
      overflow-y: auto;
      box-shadow: 4px 0 32px rgba(31, 38, 135, 0.1);
    }

    .main-content {
      flex-grow: 1;
      margin-left: 260px;
      transition: 0.3s;
      padding: 25px;
      width: calc(100% - 260px);
    }

    .card,
    .modal-content,
    .bg-light {
      background: rgba(255, 255, 255, 0.4) !important;
      backdrop-filter: blur(20px) saturate(150%);
      -webkit-backdrop-filter: blur(20px) saturate(150%);
      border: 1px solid rgba(255, 255, 255, 0.6) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.9) !important;
      border-left: 1px solid rgba(255, 255, 255, 0.9) !important;
      box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1) !important;
      border-radius: 20px !important;
    }

    .card-header {
      background: transparent !important;
      border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
    }

    .form-control,
    .form-select,
    textarea {
      background: rgba(255, 255, 255, 0.5) !important;
      border: 1px solid rgba(255, 255, 255, 0.8) !important;
      color: #0f172a !important;
      backdrop-filter: blur(10px);
      border-radius: 12px;
    }

    .form-control:focus,
    .form-select:focus {
      background: rgba(255, 255, 255, 0.8) !important;
      box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.3) !important;
    }

    .brand-logo {
      width: 45px;
      height: 45px;
      background: linear-gradient(135deg, #00c6ff, #0072ff);
      color: #fff;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 1.4rem;
      box-shadow: 0 4px 10px rgba(0, 198, 255, 0.3);
      overflow: hidden;
    }

    .nav-item-custom {
      padding: 12px 20px;
      display: flex;
      align-items: center;
      gap: 15px;
      color: rgba(30, 41, 59, 0.7);
      text-decoration: none;
      border-radius: 12px;
      margin: 4px 16px;
      transition: 0.3s;
      font-weight: 600;
    }

    .nav-item-custom:hover {
      background: rgba(255, 255, 255, 0.5);
      color: #1e293b;
      transform: translateX(4px);
    }

    .nav-item-custom.active {
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.3) 100%);
      border-left: 4px solid #0072ff;
      color: #1e293b;
      font-weight: 700;
      box-shadow: 0 4px 15px rgba(0, 114, 255, 0.1);
    }

    .nav-item-custom i {
      width: 20px;
      text-align: center;
    }

    .table-custom {
      border-collapse: separate;
      border-spacing: 0;
      width: 100%;
    }

    .table-custom th {
      background: rgba(255, 255, 255, 0.3) !important;
      color: #1e293b !important;
      font-weight: 700;
      padding: 15px;
      white-space: nowrap;
      border: none !important;
      border-bottom: 2px solid rgba(255, 255, 255, 0.8) !important;
      backdrop-filter: blur(15px) saturate(150%);
    }

    .table-custom th:first-child {
      border-top-left-radius: 16px;
    }

    .table-custom th:last-child {
      border-top-right-radius: 16px;
    }

    .table-custom td {
      padding: 15px;
      vertical-align: middle;
      border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
      background: transparent !important;
    }

    .table-custom tbody tr:hover td {
      background: rgba(255, 255, 255, 0.4) !important;
    }

    .btn-primary-gradient {
      background: linear-gradient(135deg, #0072ff, #00c6ff);
      border: none;
      color: white;
      transition: 0.3s;
    }

    .btn-primary-gradient:hover {
      background: linear-gradient(135deg, #0056b3, #00a0d2);
      color: white;
      box-shadow: 0 4px 12px rgba(0, 114, 255, 0.3);
      transform: translateY(-1px);
    }

    .text-gradient {
      background: linear-gradient(135deg, #0f172a, #0072ff);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      text-shadow: none;
      /* remove shadow if using text clip */
    }

    .modal-header.gradient-header {
      background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
      border-bottom: none !important;
    }

    .modal-header.gradient-header h5,
    .modal-header.gradient-header .modal-title {
      color: #ffffff !important;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    }

    .modal-header.gradient-header .btn-close {
      filter: invert(1) grayscale(100%) brightness(200%);
    }

    .placeholder-glow .placeholder {
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 25%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.4) 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite;
    }

    @keyframes shimmer {
      0% {
        background-position: 200% 0;
      }

      100% {
        background-position: -200% 0;
      }
    }

    .syncing-item {
      opacity: 0.5;
      pointer-events: none;
    }

    @media (max-width: 991.98px) {

      html,
      body {
        overflow-x: hidden;
        width: 100%;
      }

      .sidebar {
        left: -260px;
      }

      .sidebar.active {
        left: 0;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
      }

      .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px 10px;
        overflow-x: hidden;
      }

      .sidebar-overlay.active {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        z-index: 1030;
        backdrop-filter: blur(5px);
      }

      #invoicePreviewWrapper {
        padding-top: 110px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
      }

      .invoice-toolbar {
        flex-wrap: wrap;
        height: auto !important;
        padding: 10px !important;
        justify-content: center;
        gap: 8px;
      }

      .invoice-toolbar>div {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 5px !important;
      }

      .invoice-toolbar button {
        font-size: 10px !important;
        padding: 6px 12px !important;
        flex: 1 1 auto;
      }

      #invoicePrintArea {
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) scale(0.42) !important;
        transform-origin: top center !important;
        margin-bottom: -70% !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
      }

      .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      .table-custom.text-nowrap {
        white-space: normal !important;
      }

      .table-custom {
        font-size: 11.5px !important;
      }

      .table-custom th,
      .table-custom td {
        padding: 8px 6px !important;
      }

      .table-custom .btn {
        padding: 4px 8px;
        font-size: 10px;
      }
    }

    #invoicePreviewWrapper {
      display: none;
      background: #525659;
      min-height: 100vh;
      padding-top: 80px;
      padding-bottom: 40px;
    }

    .invoice-toolbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 70px;
      background: #323639;
      z-index: 1050;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 20px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    #invoicePrintArea {
      position: relative;
      background: white;
      padding: 40px;
      font-family: sans-serif;
      color: black;
      width: 210mm;
      margin: 0 auto;
      box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
      overflow: hidden;
    }

    .invoice-watermark {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) rotate(-45deg);
      font-size: 130px;
      font-weight: 900;
      opacity: 0.5;
      pointer-events: none;
      z-index: 10;
      letter-spacing: 15px;
      text-transform: uppercase;
    }

    .watermark-dp {
      color: #dc3545;
    }

    .watermark-lunas {
      color: #198754;
    }

    .inv-content {
      position: relative;
      z-index: 1;
    }

    .inv-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 40px;
    }

    .inv-brand {
      display: flex;
      align-items: center;
      gap: 15px;
    }

    .inv-logo {
      width: 60px;
      height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 24px;
      color: #000;
      overflow: hidden;
      border-radius: 50%;
      border: 2px solid #000;
    }

    .inv-logo img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .inv-title {
      font-size: 48px;
      font-weight: 900;
      letter-spacing: 2px;
      margin: 0;
      line-height: 1;
      color: #000;
    }

    .inv-meta-row {
      display: flex;
      justify-content: space-between;
      margin-bottom: 30px;
      font-size: 14px;
      color: #000;
    }

    .inv-table {
      width: 100%;
      border-collapse: collapse;
      margin-bottom: 30px;
      color: #000;
    }

    .inv-table th {
      background-color: #e0e0e0 !important;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
      padding: 10px;
      text-align: left;
      font-weight: bold;
      border-bottom: 2px solid #000;
      border-radius: 0;
      backdrop-filter: none;
    }

    .inv-table td {
      padding: 10px;
      border-bottom: 1px solid #ccc;
      background: transparent !important;
    }

    .inv-summary-box {
      width: 350px;
      float: right;
      color: #000;
    }

    .inv-summary-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 10px;
    }

    .inv-summary-row.bg-gray {
      background-color: #e0e0e0 !important;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
      font-weight: bold;
    }

    .inv-footer {
      margin-top: 30px;
      clear: both;
      display: flex;
      justify-content: space-between;
      font-size: 14px;
      color: #000;
    }

    @media print {
      body {
        background-color: white !important;
        background-image: none !important;
      }

      #mainApp,
      #loginPage,
      .modal,
      .swal2-container,
      .invoice-toolbar {
        display: none !important;
      }

      #invoicePreviewWrapper {
        display: block !important;
        padding: 0 !important;
        background: white !important;
      }

      #invoicePrintArea {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        min-height: auto !important;
      }

      @page {
        margin: 10mm;
        size: A4 portrait;
      }
    }
