:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --dark-color: #2C3E50;
    --light-gray: #F7F9FC;
    --text-color: #2D3748;
    --border-color: #E2E8F0;
    --success-color: #51CF66;
    --white: #FFFFFF;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 47px;
    display: flex;
    align-items: center;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    height: 47px;
}

header .logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: 47px;
}

header .logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    height: 47px;
}

header .logo-icon {
    font-size: 1.3rem;
    line-height: 1;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
    display: none;
}

header h1 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    color: var(--dark-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .nav-links {
    list-style: none;
    display: flex;
    gap: 0.3rem;
    align-items: center;
    padding: 0;
    margin: 0;
    flex: 1;
    height: 47px;
    overflow: visible;
}

header .nav-links li {
    flex: 0 0 auto;
    height: 47px;
    display: flex;
    align-items: center;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.user-avatar {
    padding: 0;
}

.user-menu-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 6px 10px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 180px;
    display: none;
    flex-direction: column;
    z-index: 101;
}

.user-menu.open .user-dropdown {
    display: flex;
}

.user-dropdown a {
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.user-dropdown a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.nav-more-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-more-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 6px 12px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-more-btn:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.nav-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 200px;
    margin-top: 8px;
    display: none;
    flex-direction: column;
    z-index: 101;
}

.nav-more-menu.active {
    display: flex;
}

.nav-more-menu a {
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-more-menu a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-more-menu a:first-child {
    border-radius: 12px 12px 0 0;
}

.nav-more-menu a:last-child {
    border-radius: 0 0 12px 12px;
}

header .nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

header .nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

header .btn-create {
    background: linear-gradient(135deg, var(--primary-color), #FF8E53);
    color: white;
    font-weight: 600;
    padding: 6px 12px;
    height: 32px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

header .btn-create:hover {
    background: linear-gradient(135deg, #FF8E53, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

header .btn-register {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

header .btn-register:hover {
    background-color: #3DBDB4;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.4);
}

header .user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header .user-name {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.6rem 1rem;
    background-color: var(--light-gray);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu-avatar { flex-shrink: 0; }

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--light-gray);
}

.lang-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    background-color: var(--light-gray);
    transition: all 0.3s ease;
}

.lang-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a252f 100%);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 300;
}

.footer-section a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.footer-logo .logo-icon {
    font-size: 2rem;
}

.footer-logo h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    font-weight: 300;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

/* Main */
main {
    padding: 3rem 0;
    min-height: calc(100vh - 300px);
}

main h1, main h2, main h3 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    background: linear-gradient(135deg, var(--primary-color), #FF8E53);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #3DBDB4);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--light-gray);
    color: var(--dark-color);
}

.badge-success {
    background: rgba(81, 207, 102, 0.15);
    color: #2b8a3e;
}

.badge-warning {
    background: rgba(255, 200, 0, 0.18);
    color: #9c6f00;
}

.badge-secondary {
    background: rgba(78, 205, 196, 0.15);
    color: #18736c;
}

.muted {
    color: #6b7280;
}

.card-badges {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.brigade-visibility-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.brigade-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.brigade-badges .muted {
    font-size: 0.9rem;
}

.brigade-visibility {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.brigade-select {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

label.brigade-pill {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s ease;
}

label.brigade-pill:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

label.brigade-pill input {
    display: none;
}

label.brigade-pill input:checked + span {
    color: var(--primary-color);
    font-weight: 700;
}

.brigade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.brigade-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.brigade-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.brigade-description {
    color: #4a5568;
}

.brigade-description.muted {
    color: #6b7280;
}

.brigade-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.brigade-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.brigade-member-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.brigade-member-list li {
    background: #fff;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.member-name {
    font-weight: 600;
}

.member-email {
    color: #718096;
}

.brigade-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.brigade-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Forms */
form {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: var(--light-gray);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert ul {
    margin-left: 1.5rem;
}

.alert-error {
    background-color: #fee;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.alert-success {
    background-color: #d4edda;
    border-left: 4px solid var(--success-color);
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    border-left: 4px solid var(--secondary-color);
    color: #0c5460;
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.recipe-card {
    background-color: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.recipe-card-content {
    padding: 1.5rem;
}

.recipe-card h3 {
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.recipe-card h3 a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color 0.3s;
}

.recipe-card h3 a:hover {
    color: var(--primary-color);
}

.recipe-card p {
    color: #718096;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #718096;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.recipe-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Recipe Detail */
.recipe-detail {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.recipe-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.recipe-header h1 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.ingredients-list {
    list-style: none;
    padding-left: 0;
}

.ingredients-list li {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background-color: var(--light-gray);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

/* Avatar */
.avatar {
    --avatar-size: 32px;
    width: var(--avatar-size);
    height: var(--avatar-size);
    min-width: var(--avatar-size);
    min-height: var(--avatar-size);
    border-radius: 50%;
    background: #1e66f5;
    border: 1px solid var(--border-color);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-transform: uppercase;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    flex-shrink: 0;
    line-height: 1;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    object-position: center;
}

.avatar-initial {
    font-size: calc(var(--avatar-size) * 0.45);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
}

.avatar-preview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.avatar-preview .avatar {
    background: #1e66f5;
    color: #ffffff;
    border-radius: 50%;
}

.avatar-preview .avatar-initial {
    color: #ffffff;
}

.checkbox-inline label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.avatar-sm { --avatar-size: 24px; }
.avatar-md { --avatar-size: 32px; }
.avatar-lg { --avatar-size: 48px; }

/* Design system (admin) */
.design-system { display: flex; flex-direction: column; gap: 2rem; }
.ds-section { background: #fff; border: 1px solid var(--border-color); border-radius: 16px; padding: 1.75rem; box-shadow: 0 8px 30px rgba(0,0,0,0.05); }
.ds-header { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.ds-header h2 { margin: 0; font-size: 1.4rem; color: var(--dark-color); }
.ds-header p { margin: 0; color: #4a5568; }
.ds-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ds-principle { padding: 1rem; border: 1px dashed var(--border-color); border-radius: 12px; background: var(--light-gray); }
.ds-principle h3 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--dark-color); }
.ds-principle p { margin: 0; color: #4a5568; font-size: 0.95rem; }
.ds-swatches { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ds-swatch { border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); background: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.04); }
.ds-swatch-color { height: 70px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.ds-swatch-meta { padding: 0.8rem 1rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; color: #4a5568; }
.ds-swatch-meta span { display: block; }
.ds-typography { display: grid; gap: 1rem; }
.ds-type-line { padding: 1rem; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.ds-type-meta { color: #4a5568; font-size: 0.9rem; margin-top: 0.35rem; }
.ds-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.ds-badges { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.ds-alerts { display: grid; gap: 0.75rem; }
.ds-forms { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ds-forms .form-group { margin-bottom: 0; }
.ds-card-sample { border: 1px solid var(--border-color); border-radius: 14px; overflow: hidden; box-shadow: 0 6px 22px rgba(0,0,0,0.06); background: #fff; }
.ds-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ds-table-wrapper { border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,0.05); background: #fff; }
.ds-metrics { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ds-metric { padding: 1rem; border-radius: 12px; background: var(--light-gray); border: 1px solid var(--border-color); }
.ds-metric .label { color: #4a5568; font-size: 0.9rem; }
.ds-metric .value { font-size: 1.3rem; font-weight: 700; color: var(--dark-color); }
.ds-avatar-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ds-token { font-family: monospace; background: var(--light-gray); padding: 0.1rem 0.35rem; border-radius: 6px; border: 1px solid var(--border-color); }
.ds-type-display { font-size: 32px; font-weight: 700; }
.ds-type-h1 { font-size: 28px; font-weight: 700; }
.ds-type-h2 { font-size: 22px; font-weight: 600; }
.ds-type-body { font-size: 16px; font-weight: 400; }
.ds-type-caption { font-size: 13px; font-weight: 500; letter-spacing: 0.2px; }

/* Responsive */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        gap: 1rem;
    }

    header .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    form {
        padding: 1.5rem;
    }
}
