
    :root {
      --bg-color: #0b1120;
      --sidebar-bg: rgba(15, 23, 42, 0.82);
      --card-bg: rgba(30, 41, 59, 0.68);
      --text-primary: #f8fafc;
      --text-secondary: #94a3b8;
      --accent-color: #0ea5e9;
      --accent-hover: #38bdf8;
      --danger: #ef4444;
      --success: #10b981;
      --warning: #f59e0b;
      --border-color: rgba(148, 163, 184, 0.16);
      --glass-border: rgba(255, 255, 255, 0.08);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
      background-color: var(--bg-color);
      color: var(--text-primary);
      line-height: 1.6;
      background-image:
        radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.16), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.12), transparent 25%);
      background-attachment: fixed;
      min-height: 100vh;
    }

    .glass-card {
      background: var(--card-bg);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid var(--glass-border);
      border-radius: 16px;
      box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    }

    .app-container {
      display: flex;
      min-height: 100vh;
    }

    .sidebar {
      width: 260px;
      background: var(--sidebar-bg);
      backdrop-filter: blur(20px);
      border-right: 1px solid var(--glass-border);
      display: flex;
      flex-direction: column;
      padding: 24px 0;
      position: sticky;
      top: 0;
      height: 100vh;
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 24px 32px;
      font-size: 24px;
      font-weight: 700;
      color: var(--accent-color);
    }

    .logo i {
      font-size: 28px;
    }

    .nav-links {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 0 16px;
    }

    .nav-links li {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 12px 16px;
      border-radius: 12px;
      cursor: pointer;
      color: var(--text-secondary);
      transition: all 0.3s ease;
      font-weight: 500;
      user-select: none;
    }

    .nav-links li:hover,
    .nav-links li.active {
      background: rgba(14, 165, 233, 0.1);
      color: var(--accent-color);
    }

    .main-content {
      flex: 1;
      padding: 32px;
      overflow-x: hidden;
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 32px;
      gap: 16px;
    }

    .topbar h1 {
      font-size: 28px;
      font-weight: 600;
    }

    .topbar-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .summary-cards {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 24px;
      margin-bottom: 32px;
    }

    .card {
      padding: 24px;
      display: flex;
      align-items: center;
      gap: 20px;
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .card:hover {
      transform: translateY(-4px);
      box-shadow: 0 10px 40px rgba(14, 165, 233, 0.13);
    }

    .card-icon {
      width: 60px;
      height: 60px;
      border-radius: 16px;
      background: rgba(14, 165, 233, 0.15);
      color: var(--accent-color);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      flex: 0 0 auto;
    }

    .card-info h3 {
      font-size: 14px;
      color: var(--text-secondary);
      margin-bottom: 4px;
      font-weight: 500;
    }

    .card-info p {
      font-size: 24px;
      font-weight: 700;
    }

    .dashboard-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 24px;
    }

    .panel {
      padding: 24px;
    }

    .section-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 24px;
      gap: 16px;
    }

    .section-header h2 {
      font-size: 18px;
      font-weight: 600;
    }

    .btn {
      padding: 10px 18px;
      border-radius: 10px;
      border: none;
      font-family: inherit;
      font-weight: 500;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.3s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      text-decoration: none;
      white-space: nowrap;
    }

    .primary-btn {
      background: var(--accent-color);
      color: white;
      box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    }

    .primary-btn:hover {
      background: var(--accent-hover);
      box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
    }

    .secondary-btn {
      background: transparent;
      color: var(--text-secondary);
      border: 1px solid var(--border-color);
    }

    .secondary-btn:hover {
      color: var(--text-primary);
      border-color: var(--text-secondary);
    }

    .danger-btn {
      background: rgba(239, 68, 68, 0.14);
      color: #fecaca;
      border: 1px solid rgba(239, 68, 68, 0.25);
    }

    .danger-btn:hover {
      background: rgba(239, 68, 68, 0.24);
    }

    .log-list,
    .tank-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .log-item,
    .tank-row {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      background: rgba(15, 23, 42, 0.42);
      border-radius: 12px;
      border: 1px solid var(--border-color);
    }

    .log-date {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 64px;
      height: 64px;
      background: rgba(14, 165, 233, 0.1);
      border-radius: 12px;
      color: var(--accent-color);
      flex: 0 0 auto;
    }

    .log-date .day {
      font-size: 20px;
      font-weight: 700;
    }

    .log-date .month {
      font-size: 12px;
      font-weight: 500;
    }

    .log-details,
    .tank-details {
      flex: 1;
      min-width: 0;
    }

    .log-details h4,
    .tank-details h4 {
      font-size: 16px;
      margin-bottom: 4px;
    }

    .log-details p,
    .tank-details p,
    .empty-text {
      font-size: 13px;
      color: var(--text-secondary);
    }

    .log-tags {
      display: flex;
      gap: 8px;
      margin-top: 8px;
      flex-wrap: wrap;
    }

    .tag {
      font-size: 11px;
      padding: 4px 8px;
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-secondary);
    }

    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.62);
      backdrop-filter: blur(5px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
      padding: 16px;
    }

    .modal-overlay.active {
      opacity: 1;
      pointer-events: all;
    }

    .modal {
      width: 100%;
      max-width: 560px;
      padding: 32px;
      transform: translateY(20px);
      transition: transform 0.3s ease;
      max-height: 90vh;
      overflow-y: auto;
    }

    .modal-overlay.active .modal {
      transform: translateY(0);
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 24px;
      gap: 16px;
    }

    .close-btn {
      background: transparent;
      border: none;
      color: var(--text-secondary);
      font-size: 20px;
      cursor: pointer;
      transition: color 0.3s;
    }

    .close-btn:hover {
      color: var(--text-primary);
    }

    .form-group {
      margin-bottom: 20px;
    }

    .form-row {
      display: flex;
      gap: 16px;
    }

    .form-row .form-group {
      flex: 1;
    }

    label {
      display: block;
      font-size: 14px;
      color: var(--text-secondary);
      margin-bottom: 8px;
      font-weight: 500;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
      width: 100%;
      padding: 12px 16px;
      border-radius: 10px;
      background: rgba(15, 23, 42, 0.55);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      font-family: inherit;
      transition: border-color 0.3s;
    }

    input:focus,
    select:focus,
    textarea:focus {
      outline: none;
      border-color: var(--accent-color);
    }

    .checkbox-group {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
    }

    .checkbox-group label {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 0;
      cursor: pointer;
      color: var(--text-primary);
    }

    .modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 16px;
      margin-top: 32px;
      flex-wrap: wrap;
    }

    .content-area {
      display: none;
    }

    .content-area.active {
      display: block;
    }

    .empty-box {
      padding: 28px;
      text-align: center;
      border: 1px dashed var(--border-color);
      border-radius: 14px;
      color: var(--text-secondary);
      background: rgba(15, 23, 42, 0.25);
    }

    .calendar-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }

    .calendar-title {
      font-size: 20px;
      font-weight: 700;
    }

    .calendar-controls {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 10px;
    }

    .calendar-weekday {
      color: var(--text-secondary);
      font-size: 13px;
      text-align: center;
      padding: 8px 4px;
    }

    .calendar-day {
      min-height: 108px;
      padding: 10px;
      border-radius: 14px;
      border: 1px solid var(--border-color);
      background: rgba(15, 23, 42, 0.36);
      cursor: pointer;
      transition: 0.25s ease;
      overflow: hidden;
    }

    .calendar-day:hover {
      border-color: var(--accent-color);
      transform: translateY(-2px);
    }

    .calendar-day.muted {
      opacity: 0.35;
      cursor: default;
    }

    .calendar-day.today {
      border-color: var(--accent-color);
      box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.25);
    }

    .calendar-date-number {
      font-weight: 700;
      margin-bottom: 8px;
    }

    .calendar-log-chip {
      display: block;
      font-size: 11px;
      padding: 4px 6px;
      border-radius: 7px;
      margin-top: 5px;
      color: #e0f2fe;
      background: rgba(14, 165, 233, 0.22);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .calendar-log-chip.ph {
      color: #fee2e2;
      background: rgba(239, 68, 68, 0.22);
    }

    .day-detail-box {
      margin-top: 20px;
      padding: 20px;
    }

    @media (max-width: 768px) {
      .app-container { flex-direction: column; }
      
      .sidebar {
        width: 100%;
        padding: 8px 16px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        height: auto;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        border-bottom: none;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 100;
        background: rgba(15, 23, 42, 0.95);
        padding-bottom: calc(8px + env(safe-area-inset-bottom)); /* iPhone notch support */
      }

      .logo { display: none; }

      .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        padding: 0;
      }

      .nav-links li {
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        font-size: 10px;
        flex: 1;
        text-align: center;
        border-radius: 12px;
      }

      .nav-links li i { font-size: 20px; margin-bottom: 2px; }
      .nav-links li span { display: block; font-size: 10px; }

      .main-content {
        padding: 16px;
        padding-bottom: 90px; /* space for bottom nav */
      }

      .topbar { margin-bottom: 20px; flex-direction: column; align-items: flex-start; }
      .topbar h1 { font-size: 22px; }
      .topbar-actions { width: 100%; justify-content: flex-start; }

      .summary-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
      .card { padding: 16px; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
      .card-icon { width: 44px; height: 44px; font-size: 20px; }
      .card-info p { font-size: 20px; }

      .modal { padding: 24px 16px; width: 90%; max-height: 85vh; border-radius: 20px; }
      .form-row { flex-direction: column; gap: 0; }
      .checkbox-group { gap: 12px; }
      .checkbox-group label { padding: 8px 0; }

      .log-item, .tank-row { align-items: flex-start; flex-direction: column; gap: 12px; }
      .log-date { width: 100%; height: auto; padding: 8px; flex-direction: row; gap: 8px; }
      .log-date .day { font-size: 16px; }
      .log-date .month { font-size: 14px; }
    }
  

/* AquaLog complete fixed additions */
.logo-img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex: 0 0 auto;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.logo-text strong {
  font-size: 22px;
  color: #e0f2fe;
}
.logo-text span {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.nav-links li,
.btn,
.calendar-day {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-links li span,
.btn {
  pointer-events: none;
}
button, input, select, textarea {
  font-size: 16px;
}
@media (max-width: 768px) {
  body { overflow-x: hidden; }
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .calendar-grid { gap: 5px; }
  .calendar-day { min-height: 76px; padding: 7px 5px; }
  .calendar-log-chip { font-size: 10px; padding: 3px 4px; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .section-header .btn { width: 100%; }
}
@media (max-width: 420px) {
  .summary-cards { grid-template-columns: 1fr; }
  .nav-links li { padding: 8px 4px; }
  .nav-links li span { font-size: 9px; }
  .card-info p { font-size: 18px; }
}
