/* Global Styles - Modern Minimalist */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #4f46e5; /* indigo-600 */
  --primary-600: #4338ca;
  --ring: rgba(79, 70, 229, 0.25);
  --shadow: 0 6px 18px rgba(27, 43, 65, 0.08);
  --navbar-height: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: 'Inter', 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-app { background-color: var(--bg); }

/* Links */
 a { color: var(--primary); text-decoration: none; transition: color .2s ease; }
 a:hover { color: var(--primary-600); text-decoration: none; }

/* Buttons */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}
.btn-primary:hover {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
}
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background-color: var(--primary); color: #fff; }

/* Forms */
.form-control,
.form-select {
  border-radius: 12px;
  border-color: #e5e7eb;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* Cards */
.card {
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.card-title { font-weight: 600; }
.card-subtitle { color: var(--muted); }

/* Navbar */
.navbar-glass {
  background-color: rgba(255,255,255,0.75);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Ensure navbar (header) appears above the sidebar on small screens */
.navbar-glass {
  z-index: 1045; /* above sidebar (which is 1020 in dashboard.css) but below modals (1055) */
}

/* Slightly lower sidebar z-index than navbar to avoid burying header controls on mobile */
.sidebar {
  z-index: 1040; /* keep above most content but below navbar */
}

/* Utility */
.text-muted-700 { color: var(--muted); }
.rounded-12 { border-radius: 12px; }
.shadow-soft { box-shadow: var(--shadow); }

/* Animation helpers */
.fade-in-up { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.fade-in-up.show { opacity: 1; transform: translateY(0); }

/* Utilities */
.min-vh-80 { min-height: 80vh; }

/* Components */
.brand-icon {
  width: 56px;
  height: 56px;
  background: #eef2ff;
  color: var(--primary);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

/* Centered Offcanvas (custom) */
.offcanvas.offcanvas-centered {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(560px, 95vw);
  max-width: 560px;
  max-height: 85vh;
  border-radius: .5rem;
}
.offcanvas.offcanvas-centered.show {
  transform: translate(-50%, -50%);
}

/* Responsive stacked-card layout for Create Transaction items table on small screens */
@media (max-width: 575.98px) {
  #modalCreateTransaction .table-responsive { overflow: visible; }
  #modalCreateTransaction #txItemsTable thead { display: none; }
  #modalCreateTransaction #txItemsTable tbody tr {
    display: block;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: .375rem;
    margin-bottom: .6rem;
    padding: .5rem;
    background: #fff;
  }
  #modalCreateTransaction #txItemsTable tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .35rem 0;
    border: none;
  }
  #modalCreateTransaction #txItemsTable tbody tr td:before {
    content: attr(data-label);
    flex: 0 0 45%;
    max-width: 45%;
    font-weight: 600;
    color: #6c757d;
    margin-right: .5rem;
    text-align: left;
    white-space: nowrap;
  }
  #modalCreateTransaction #txItemsTable .form-control,
  #modalCreateTransaction #txItemsTable .form-select { padding: .35rem .5rem; font-size: .95rem; }
  #modalCreateTransaction #txItemsTable td.text-end { justify-content: flex-end; }
  #modalCreateTransaction #txItemsTable td.action-cell .btn { padding: .3rem .45rem; min-width: 38px; height: 36px; display:inline-flex; align-items:center; justify-content:center; }
  #modalCreateTransaction .add-row-btn { position: static; margin-top: .5rem; }
}
