@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;800&display=swap');

:root {
  --primary: #047857; /* Emerald */
  --primary-hover: #065f46;
  --accent: #f59e0b; /* Amber */
  --accent-hover: #d97706;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 20px; /* Apple-like rounded */
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #10b981;
  --primary-hover: #059669;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Utilities */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-title {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  width: 100%;
  margin-bottom: 12px;
}

.btn:hover, .btn:focus {
  background: var(--bg);
  border-color: var(--primary);
  outline: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.3);
}

.btn.primary:hover, .btn.primary:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(4, 120, 87, 0.4);
}

.btn.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border: none;
}

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.05rem;
  font-family: inherit;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

/* Grid/Layout */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Navbar */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.8);
}
@media (prefers-color-scheme: dark) {
  .navbar { background: rgba(30, 41, 59, 0.8); }
}

.nav-brand {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary);
  text-decoration: none;
}

/* List Items */
.list-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-item:last-child {
  border-bottom: none;
}

/* Layout Adjustments */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#main-content {
  flex: 1;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dropdown-toggle:hover, .dropdown-toggle:focus {
    background: rgba(0,0,0,0.05);
    outline: none;
}
:root[data-theme="dark"] .dropdown-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--surface);
    min-width: 140px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 1000;
    flex-direction: column;
    padding: 4px;
}
.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
}
.dropdown-item:hover {
    background: var(--bg);
}
.dropdown-item.text-danger {
    color: #dc2626;
}
.dropdown-item.text-danger:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Scrollable Item Name */
.item-name-scrollable {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    display: block;
    scrollbar-width: none;
}
.item-name-scrollable::-webkit-scrollbar {
    display: none;
}

