/* assets/css/styles.css */

/* --- DESIGN TOKENS --- */
:root {
    /* Color Palette: Vibrant Emerald & Deep Slate */
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-500: #10b981;
    --primary-600: #059669;
    /* Main Brand */
    --primary-700: #047857;
    --primary-gradient: linear-gradient(135deg, #6b716f 0%, #059669 100%);

    --secondary-50: #f0f9ff;
    --secondary-500: #0ea5e9;
    /* Sky Blue */
    --secondary-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);

    --bg-body: #f1f5f9;
    /* Cool Gray */
    --bg-card: #ffffff;
    --bg-subtle: #f8fafc;

    --text-main: #0f172a;
    /* Slate 900 */
    --text-secondary: #334155;
    /* Slate 700 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;

    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: #10b981;

    --warning: #f59e0b;
    --danger: #ef4444;

    /* Shadows & Radius (Modern & Soft) */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Neomorphic / Glassy touches */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);

    --radius-md: 0.75rem;
    /* 12px */
    --radius-lg: 1rem;
    /* 16px */
    --radius-xl: 1.5rem;
    /* 24px */
}

/* --- RESET & BASE --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    /* Subtle background pattern/gradient */
    background-image:
        radial-gradient(at 0% 0%, hsla(153, 96%, 41%, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(199, 89%, 48%, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    /* Sticky Footer Layout */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4 {
    margin-top: 0;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Links */
a {
    color: var(--primary-600);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

a:hover {
    color: var(--primary-700);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* --- LAYOUT --- */
.container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar - Modern Floating Style */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.brand::before {
    content: '🌱';
    font-size: 1.25rem;
    -webkit-text-fill-color: initial;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: var(--primary-50);
    color: var(--primary-700);
    text-decoration: none;
}

/* Active indicator dot optionally */

/* GRAZE-016: Mobile Hamburger Menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    position: relative;
    transition: all 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    left: 0;
    transition: all 0.3s;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    bottom: -7px;
}

/* Hamburger animation when active */
.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Responsive Nav */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-container {
        flex-wrap: wrap;
        position: relative;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.25rem;
        padding: 1rem 0;
        border-top: 1px solid var(--border-color);
        margin-top: 0.75rem;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-md);
    }

    .nav-links a:hover,
    .nav-links a.active {
        background-color: var(--primary-50);
    }
}

/* Card System - Modern & Floating */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Subtle white border */
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Top accent line for cards */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.card:hover::before {
    opacity: 1;
}

.card-title {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-body);
}

/* --- COMPONENTS --- */

/* Modern Buttons (Flat, no outlines) */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: var(--radius-lg);
    /* Pill shape almost */
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 8px 15px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--text-light);
    color: var(--text-main);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-100);
    color: var(--primary-600);
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Forms - Floating Label Style or Modern Filled */
iinput,
select,
textarea {
    width: 100%;
}

/* Fix typo: 'iinput' -> 'input' safety handled by next rules */

input,
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background-color: #f1f5f9;
    /* Light gray background */
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 500;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background-color: white;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
}

/* Fix select chevron */
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    appearance: none;
}

label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.8em;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-info {
    background: var(--secondary-50);
    color: var(--secondary-500);
}

/* --- PAGE SPECIFIC --- */

/* Login Page */
.login-wrapper {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    border-top: 5px solid var(--primary-500);
    /* Accent */
}

.login-logo {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Planner Grid */
.planner-grid-wrapper {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    background: white;
    border: none;
    overflow: hidden;
}

.table-planner th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 1.25rem 1rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.table-planner td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--bg-body);
    border-right: 1px solid var(--bg-body);
    vertical-align: top;
}

.table-planner tr:last-child td {
    border-bottom: none;
}

.table-planner td:hover {
    background-color: var(--primary-50);
}

/* Cell States */
.cell-approved strong {
    color: var(--primary-700);
    font-size: 1.15rem;
    display: block;
    margin-bottom: 0.25rem;
}

.cell-suggested strong {
    color: var(--secondary-500);
}

/* Dashboard Cards */
.card p.approved-text {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 1rem 0;
}

.card-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
}

/* Modals - Glassy Fixed Overlay */
.modal-overlay {
    /* Full-screen fixed positioning */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;

    /* Backdrop styling */
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Centering the modal content */
    display: none;
    justify-content: center;
    align-items: center;

    /* Smooth transition */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex !important;
    opacity: 1;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: none;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Utilities */
.d-flex {
    display: flex;
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 1rem;
}

.text-center {
    text-align: center;
}

.scroll-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--bg-body);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

/* --- FOOTER (Sticky at Bottom) --- */
.page-content {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer p {
    margin: 0;
    color: var(--text-muted);
}


/* --- SAAS PLANNER UI POLISH --- */

/* Scroll Container */
.planner-grid-wrapper {
    position: relative;
    max-height: 85vh;
    overflow: auto;
    border: 1px solid var(--border-color);
    background: #fff;
}

/* Sticky Headers & Columns */
.sticky-top-1 {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #f8fafc;
    /* Match header bg */
    box-shadow: 0 1px 0 var(--border-color);
}

.sticky-top-2 {
    position: sticky;
    top: 41px;
    /* Height of Row 1 approx */
    z-index: 40;
    background: #f8fafc;
    box-shadow: 0 1px 0 var(--border-color);
}

.sticky-col {
    position: sticky;
    left: 0;
    z-index: 30;
    background: #fff;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.05);
}

/* Fix corner overlap */
.sticky-corner {
    z-index: 50 !important;
    left: 0;
    top: 0;
    /* Or appropriate top for 2nd row corner */
    background: #f8fafc;
}

/* Planner Card Cell */
.planner-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    height: 100%;
    min-height: 70px;
    position: relative;
    transition: all 0.15s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.planner-card:hover {
    border-color: var(--primary-500);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    z-index: 100;
}

/* Typography */
.paddock-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-right: 30px;
    /* Space for badge */
    margin-bottom: 4px;
}

/* --- PLANNER CARD THEMES (Pastel) --- */
.card-short {
    background: #fef2f2;
    /* Red-50 */
    border-color: #fecaca;
    /* Red-200 */
}

.card-short:hover {
    border-color: #ef4444;
    /* Red-500 */
}

.card-short .planner-badge {
    background: #ef4444 !important;
    color: #fff !important;
}

.card-optimal {
    background: #fff7ed;
    /* Orange-50 */
    border-color: #fed7aa;
    /* Orange-200 */
}

.card-optimal:hover {
    border-color: #f97316;
    /* Orange-500 */
}

.card-optimal .planner-badge {
    background: #f97316 !important;
    color: #fff !important;
}

.card-long {
    background: #f0fdf4;
    /* Green-50 */
    border-color: #bbf7d0;
    /* Green-200 */
}

.card-long:hover {
    border-color: #22c55e;
    /* Green-500 */
}

.card-long .planner-badge {
    background: #22c55e !important;
    color: #fff !important;
}

/* GRAZE-NEW: Non-Lactating / Dry Herd Theme */
.card-dry {
    background: #fff8e1;
    /* Amber-50 */
    border-color: #fcd34d;
    /* Amber-300 */
}

.card-dry:hover {
    border-color: #f59e0b;
    /* Amber-500 */
}

.card-dry .planner-badge {
    background: #f59e0b !important;
    color: #fff !important;
}

/* Base Badge - Pill at Bottom Left */
.planner-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    top: auto;
    /* Override previous top */
    right: auto;
    /* Override previous right */
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

/* Rest Text in Card Key Details */
.card-rest-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
    display: block;
}

/* Action Buttons - Bottom Right */
.card-actions {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    z-index: 25;
}


.card-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    align-items: center;
    margin-top: 4px;
}

.meta-icon {
    font-size: 12px;
}

/* Status Styles */
.status-suggested {
    border: 1px dashed var(--primary-500);
    background: #f0fdf4;
    /* Light green tint */
}

.status-suggested .paddock-name {
    color: var(--primary-700);
}

.status-completed {
    background: #f1f5f9;
    border-color: #cbd5e1;
    opacity: 0.8;
}

.status-completed .paddock-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.empty-card {
    border: 1px dashed var(--border-color);
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 13px;
    border-radius: 6px;
    min-height: 70px;
}

.empty-card:hover {
    border-color: var(--primary-400);
    color: var(--primary-600);
    background: #fff;
}

/* Tooltip (CSS only implementation) */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: var(--text-main, #1e293b);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 11px;
    white-space: pre;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color, #e2e8f0);
    border-left: 3px solid var(--primary-500, #10b981);
    min-width: 160px;
    text-align: left;
    margin-bottom: 8px;
    line-height: 1.5;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #ffffff;
    margin-bottom: -4px;
    z-index: 101;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
}

.stat-icon.amber {
    background: rgba(245, 158, 11, 0.15);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.15);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.dashboard-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.widget-body {
    padding: 0;
    min-height: 250px;
    position: relative;
}

.widget-body.padded {
    padding: 1.25rem;
}

#dashboard-map {
    width: 100%;
    height: 250px;
}

.weather-current {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.weather-temp {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.weather-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.weather-icon {
    font-size: 3rem;
}

.weather-forecast {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    padding: 1rem 1.25rem;
}

.forecast-day {
    text-align: center;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
}

.forecast-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.forecast-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.forecast-temp {
    font-weight: 600;
    font-size: 0.9rem;
}

.weather-alert {
    background: rgba(245, 158, 11, 0.1);
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: #92400e;
    display: none;
}

.weather-alert.show {
    display: block;
}

@media (max-width: 900px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }
}

/* --- AM/PM CARD THEMES --- */
.grazing-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    min-height: 200px;
    display: flex;
    flex-direction: column;

    /* UNIFIED THEME: Clean white, fresh green tint, gold accents */
    border-top: 4px solid #f59e0b;
    /* Sun Gold Border for ALL */
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    /* White to Mint-50 */
}

.grazing-card .card-title {
    color: var(--primary-700);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(16, 185, 129, 0.1);
}

/* AM Specifics */
.grazing-card.am .card-title::after {
    content: '☀️';
    font-size: 1.25rem;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
}

/* PM Specifics - Same theme, just different icon */
.grazing-card.pm .card-title::after {
    content: '🌙';
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(100, 116, 139, 0.3));
    /* Subtle shadow for moon */
}


/* --- CARD ACTIONS (Restored) --- */
.card-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 20;
    /* Above card, below tooltip */
}

.action-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-approve {
    color: #10b981;
    /* Green check */
    border-color: #a7f3d0;
    font-weight: bold;
}

.btn-approve:hover {
    background: #ecfdf5;
    color: #059669;
}

.btn-edit {
    color: #64748b;
    /* Slate pencil */
}

.btn-edit:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

/* Ensure actions don't overlap text if name is long */
.planner-card {
    padding-bottom: 30px;
    /* Space for buttons */
}