:root {
  /* Coffee Theme Palette */
  --primary: #6f4e37;       /* Coffee Bean */
  --primary-hover: #5d4037; /* Dark Roast */
  --bg: #fdfbf7;            /* Cream / Milk foam */
  --card: #ffffff;
  --text: #433422;          /* Dark Espresso text */
  --text-muted: #9c8c74;    /* Latte art color */
  --border: #e6dccf;        /* Beige border */
  --input-bg: #fffefe;
  --accent-gold: #d4a373;   /* Caramel */
  --success: #166534;       /* Organic Green */
  --danger: #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
}

/* Shared Header Layout */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}

h1, h2 {
  margin: 0;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

h1::before, h2::before {
  content: "☕";
}

/* Base Button Styles */
button {
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Dropdown Styles */
.dropdown-hidden {
    display: none;
}

.dropdown-visible {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.1s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--bg); /* Cream color */
}

.dropdown-item strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.dropdown-item span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
}

/* --- SUCCESS FEEDBACK --- */
.success-box {
    background-color: #dcfce7; /* Light Green */
    color: #166534;            /* Dark Green Text */
    border: 1px solid #86efac;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- DROPDOWN CARDS (Restoring the "Card View" look) --- */
.dropdown-visible {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    margin-top: 4px;
    padding: 0;
    list-style: none;
    max-height: 250px; /* Taller to fit cards */
    overflow-y: auto;
}

.dropdown-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #fffcf5; /* Cream hover */
    padding-left: 16px;        /* Slight shift effect */
    border-left: 4px solid var(--primary);
}

/* Typography for Dropdown Cards */
.dd-name {
    display: block;
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 2px;
}
.dd-address {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 4px;
}
.dd-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.dd-open { background: #dcfce7; color: #166534; }
.dd-closed { background: #fee2e2; color: #991b1b; }

/* global.css - Additions at the bottom */

/* --- EDIT MODE STYLES --- */
.btn-group-top {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.btn-icon:hover { opacity: 1; }

.btn-edit { color: var(--primary); }
.btn-delete { color: #ef4444; }

/* Edit Form Elements */
.edit-input {
    width: 100%;
    padding: 6px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    box-sizing: border-box;
}
.edit-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fffcf5;
}

.edit-textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    min-height: 50px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

/* Edit Action Buttons */
.edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}
.btn-save {
    background: var(--success);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}
.btn-cancel {
    background: #f4f4f4;
    color: #666;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

/* --- ADJUSTMENTS FOR COMPACT MODE --- */
.list-container.compact .edit-input {
    padding: 4px;
    font-size: 12px;
    margin-bottom: 2px;
}
.list-container.compact .edit-actions {
    margin-top: 4px;
}