/*
 * TractorTracker — main stylesheet
 *
 * Brand colors come from CSS variables set in base.html <style> based on the
 * farm's branding_config. Defaults:
 *   --color-primary:   #2d5a2d  (farm green)
 *   --color-secondary: #8b6f47  (farm brown)
 *   --color-accent:    #c85a2e  (tractor orange)
 *
 * We use Tailwind for utility classes; this file defines component classes
 * (btn, card, nav-*, alert, container) that templates reference.
 */

/* ============================================================================
   BASE
   ============================================================================ */

* {
    box-sizing: border-box;
}

html { height: 100%; }

body {
    min-height: 100%;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #374151;
    background-color: #f9fafb;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }


/* ============================================================================
   LAYOUT
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}


/* ============================================================================
   NAVIGATION
   ============================================================================ */

.nav-main {
    background-color: var(--color-primary);
    color: white;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand-logo { height: 32px; width: auto; }
.nav-brand-text { color: white; }
.nav-brand-sub {
    color: rgba(255,255,255,0.7);
    font-weight: 400;
    font-size: 0.95rem;
    margin-left: 0.25rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
}
.nav-user-role { color: rgba(255,255,255,0.6); }
.nav-user-link { color: white; }
.nav-user-link:hover { text-decoration: underline; }


/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.15s;
}
.btn:hover { text-decoration: none; opacity: 0.9; }

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}
.btn-secondary {
    background-color: white;
    color: #374151;
    border-color: #d1d5db;
}
.btn-accent {
    background-color: var(--color-accent);
    color: white;
}


/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}
.card-title {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: var(--color-primary);
}
.card-body {
    padding: 1rem;
}


/* ============================================================================
   ALERTS (flash messages)
   ============================================================================ */

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    border: 1px solid transparent;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }


/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    max-width: 1200px;
    margin: 3rem auto 1.5rem;
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
    border-top: 1px solid #e5e7eb;
}
