/* Bastas Tarım - Modern Aşı Takip Arayüzü */
:root {
    --bg: #f0f2f5;
    --bg-subtle: #e8eaef;
    --card: #ffffff;
    --primary: #1a5f4a;
    --primary-hover: #0d4a3a;
    --primary-light: rgba(26, 95, 74, 0.08);
    --accent: #d4a84b;
    --accent-soft: rgba(212, 168, 75, 0.15);
    --text: #1a1d21;
    --text-secondary: #5c6168;
    --muted: #8b9199;
    --border: #e2e5ea;
    --danger: #c23d3d;
    --danger-soft: rgba(194, 61, 61, 0.1);
    --warning: #c49a2e;
    --warning-soft: rgba(196, 154, 46, 0.12);
    --success: #2d8f6f;
    --success-soft: rgba(45, 143, 111, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: 0.2s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    padding-top: env(safe-area-inset-top, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-hover);
}
a.btn:hover {
    text-decoration: none;
}

/* ========== Header ========== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, #0d4a3a 100%);
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 12px rgba(26, 95, 74, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    position: relative;
}
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
@media (min-width: 901px) {
    .header-row { width: auto; }
}
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}
.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}
.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    margin: 0 auto;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.nav-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}
@media (max-width: 900px) {
    .nav-overlay {
        display: block;
    }
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: #fff !important;
}
.logo:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav a {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
}
.nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}
.header-user {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    margin-left: 0.25rem;
}
.header-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 400;
}
.header-logout {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-left: 0.25rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.header-logout:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
}

/* ========== Bildirim (Aşı uyarıları) ========== */
.header-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: 0.25rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.header-settings-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.notification-wrap {
    position: relative;
    margin-left: 0.25rem;
}
.notification-bell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}
.notification-bell:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}
.notification-bell {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: var(--danger);
    border-radius: 999px;
    border: 2px solid var(--primary);
}
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: min(360px, calc(100vw - 2rem));
    max-height: 70vh;
    overflow: auto;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    z-index: 200;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: visibility 0.2s, opacity 0.2s, transform 0.2s;
}
.notification-dropdown.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}
.notification-dropdown-header {
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
.notification-empty {
    padding: 1.25rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.notification-group {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.notification-group:last-of-type {
    border-bottom: none;
}
.notification-group-title {
    padding: 0.5rem 1rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.notification-group-title.due-overdue {
    color: var(--danger);
}
.notification-group-title.due-soon {
    color: var(--warning);
}
.notification-item {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background var(--transition);
}
.notification-item:hover {
    background: var(--primary-light);
    text-decoration: none;
    color: var(--text);
}
.notification-item-overdue {
    border-left-color: var(--danger);
}
.notification-item-soon {
    border-left-color: var(--warning);
}
.notification-item-animal {
    display: block;
    font-weight: 500;
    color: var(--text);
}
.notification-item-asi {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.notification-item-date {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.15rem;
}
.notification-footer {
    display: block;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    color: #0d3d30;
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius) var(--radius);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.notification-footer:hover {
    background: #d0d4dc;
    color: #062a20;
}
.notification-footer:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.notification-wrap.bildirimler-okundu .notification-badge {
    display: none;
}

/* Ana sayfa bildirim uyarı kutusu */
.notification-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    background: var(--warning-soft);
    border-color: rgba(196, 154, 46, 0.4);
}
.notification-alert .due-overdue { color: var(--danger); font-weight: 600; }
.notification-alert .due-soon { color: var(--warning); font-weight: 600; }

/* ========== Main ========== */
.main {
    padding: 2rem 0 3rem;
    min-height: calc(100vh - 56px);
}

/* ========== Page title ========== */
.page-title {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* ========== Cards ========== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-hover);
}

.card h2 {
    margin: 0 0 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

/* ========== Stats (dashboard) ========== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat {
    background: var(--card);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat .num {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.stat .label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-animal { border-left: 4px solid var(--primary); }
.stat-vaccine { border-left: 4px solid var(--accent); }
.stat-upcoming { border-left: 4px solid var(--success); }
.stat-overdue { border-left: 4px solid var(--danger); }

/* Welcome card */
.card-welcome .welcome-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}
.card-welcome .welcome-text {
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.7;
}

/* Ana sayfa – gecikmiş / yaklaşan aşı listeleri */
.home-with-calendar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1rem;
}
@media (max-width: 900px) {
    .home-with-calendar {
        grid-template-columns: 1fr;
    }
}

.home-asi-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.card-asi-list h2 {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}
.asi-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.asi-list li {
    border-bottom: 1px solid var(--border);
}
.asi-list li:last-child {
    border-bottom: none;
}
.asi-list-link {
    display: block;
    padding: 0.65rem 0;
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition);
}
.asi-list-link:hover {
    background: var(--primary-light);
    color: var(--text);
    text-decoration: none;
}
.asi-list-hayvan {
    display: block;
    font-weight: 500;
}
.asi-list-asi {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.asi-list-tarih {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.2rem;
    font-weight: 600;
}
.list-empty {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}
.list-more {
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}
.list-more a {
    font-weight: 500;
}

/* WhatsApp paylaşım */
.whatsapp-uyari {
    margin-bottom: 1rem;
    padding: 0.75rem 0;
}
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #25d366;
    color: #fff !important;
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition);
}
.btn-whatsapp:hover {
    background: #20bd5a;
    color: #fff !important;
    text-decoration: none;
}
.btn-whatsapp-icon { font-size: 1.2rem; }
.whatsapp-aciklama {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.notification-whatsapp {
    background: rgba(37, 211, 102, 0.15) !important;
    color: #1a7a3a !important;
}
.notification-whatsapp:hover {
    background: rgba(37, 211, 102, 0.25) !important;
    color: #1a7a3a !important;
}

/* ========== Ana sayfa takvim widget ========== */
.home-calendar-widget {
    padding: 1.25rem;
    min-width: 0;
}
.calendar-clock {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.calendar-clock-icon,
.calendar-heading-icon {
    opacity: 0.7;
    margin-right: 0.35rem;
}
.calendar-clock-label,
.calendar-heading-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.calendar-clock-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
}
.calendar-clock-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}
.calendar-section { }
.calendar-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.calendar-heading-label {
    flex: 0 0 auto;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}
.calendar-nav-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.calendar-nav-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.calendar-month-year {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    min-width: 7rem;
    text-align: center;
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 0.85rem;
}
.calendar-day {
    aspect-ratio: 1;
    max-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.calendar-day.other-month {
    color: var(--muted);
    opacity: 0.6;
}
.calendar-day.today {
    background: var(--success-soft);
    color: var(--primary);
    font-weight: 600;
}
.calendar-day:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.calendar-day.has-asi {
    font-weight: 600;
    color: var(--primary);
}

/* Takvim tarih popup */
.calendar-popup {
    position: fixed;
    z-index: 500;
    min-width: 260px;
    max-width: 320px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    padding: 0.75rem 0;
    display: none;
    pointer-events: none;
}
.calendar-popup.visible {
    display: block;
    pointer-events: auto;
}
.calendar-popup-title {
    padding: 0 1rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.calendar-popup-list {
    max-height: 220px;
    overflow-y: auto;
}
.calendar-popup-list a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background var(--transition);
}
.calendar-popup-list a:hover {
    background: var(--primary-light);
    text-decoration: none;
    color: var(--text);
}
.calendar-popup-list .popup-hayvan { font-weight: 500; }
.calendar-popup-list .popup-asi { font-size: 0.8rem; color: var(--text-secondary); }
.calendar-popup-empty {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: none;
}
.calendar-popup-empty.visible {
    display: block;
}

/* ========== İstatistikler sayfası ========== */
.stats-intro {
    color: var(--text-secondary);
    margin: -0.5rem 0 1.5rem;
    font-size: 0.95rem;
}
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.stats-dashboard .stats-card:first-child {
    grid-column: 1 / -1;
}
.stats-card {
    margin-bottom: 0;
}
.stats-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    color: var(--primary);
}
.stats-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.4;
}
.chart-wrap {
    min-height: 200px;
    margin-bottom: 0.75rem;
}
.chart-wrap-donut {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}
.stats-legend-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}
.chart-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 2rem 1rem;
    margin: 0;
}

/* Ana sayfa uyarı modalı (bugün yapılacak aşılar) */
.uyari-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}
.uyari-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}
.uyari-modal-card {
    position: relative;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.uyari-modal-header {
    padding: 1.25rem 1.5rem 0.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.uyari-modal-title {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    color: var(--primary);
}
.uyari-modal-date {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.uyari-modal-body {
    padding: 1rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.uyari-modal-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.uyari-modal-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.uyari-modal-list li {
    border-bottom: 1px solid var(--border);
}
.uyari-modal-list li:last-child {
    border-bottom: none;
}
.uyari-modal-list a {
    display: block;
    padding: 0.65rem 0;
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition);
    border-left: 3px solid transparent;
}
.uyari-modal-list a:hover {
    background: var(--primary-light);
    border-left-color: var(--primary);
    text-decoration: none;
    color: var(--text);
}
.uyari-hayvan {
    display: block;
    font-weight: 500;
}
.uyari-asi {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}
.uyari-modal-footer {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.uyari-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
}
.uyari-checkbox input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary);
}
.uyari-modal-btn {
    margin-left: auto;
}

@media (max-width: 768px) {
    .home-asi-lists {
        grid-template-columns: 1fr;
    }
    .stats-dashboard {
        grid-template-columns: 1fr;
    }
}

/* ========== Tables ========== */
.card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.card th,
.card td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.card thead th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card tbody tr {
    transition: background var(--transition);
}
.card tbody tr:hover td {
    background: var(--primary-light);
}
.card tbody tr:last-child td {
    border-bottom: none;
}

/* ========== Forms ========== */
.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}
.form-inline .form-group {
    margin-bottom: 0;
}
.form-inline .form-group label {
    margin-bottom: 0.375rem;
}
.form-stacked .form-group {
    margin-bottom: 1rem;
}
.form-stacked .form-group label {
    display: block;
    margin-bottom: 0.35rem;
}
.card-sub {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
}
.card-sub h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}
.table-users {
    width: 100%;
    margin-top: 1rem;
}
.table-users th,
.table-users td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table-users .actions {
    white-space: nowrap;
}
.table-users .actions form {
    display: inline;
}
.table-users .text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== Ayarlar sayfası – modern tasarım ========== */
.page-ayarlar {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.page-ayarlar .page-title {
    margin-bottom: 1.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.page-ayarlar .alert {
    margin-bottom: 1.25rem;
}

.settings-card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}
.settings-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);
}
.settings-card-whatsapp {
    border-left: 4px solid #25d366;
}
.settings-card-users {
    border-left: 4px solid var(--primary);
}

.settings-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.settings-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bg-subtle);
    border-radius: 12px;
    flex-shrink: 0;
}
.settings-card-whatsapp .settings-card-icon {
    background: rgba(37, 211, 102, 0.12);
}
.settings-card-users .settings-card-icon {
    background: var(--primary-light);
}
.settings-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.settings-card-desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}
.settings-card-desc strong {
    color: var(--text);
    font-weight: 600;
}

.settings-form {
    margin: 0;
}
.settings-form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}
.settings-form-inline .settings-field {
    flex: 1;
    min-width: 200px;
}
.settings-form-inline .settings-btn {
    flex-shrink: 0;
}
.settings-form-add {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 1rem 1.25rem;
    align-items: end;
}
@media (max-width: 640px) {
    .settings-form-add {
        grid-template-columns: 1fr 1fr;
    }
    .settings-form-add .settings-field-submit {
        grid-column: span 2;
    }
}
.settings-form-stacked .settings-field {
    margin-bottom: 1.25rem;
}
.settings-form-stacked .settings-actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
}

.settings-field {
    margin: 0;
}
.settings-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.settings-hint {
    font-weight: 400;
    color: var(--text-muted);
}
.settings-input {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-input:hover {
    border-color: #b8bcc4;
}
.settings-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.settings-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}
.settings-field-submit {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.settings-field-submit label {
    margin-bottom: 0.4rem;
}
.settings-field-submit .btn {
    width: 100%;
    min-width: 100px;
}

.settings-sub-card {
    background: var(--bg-subtle);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}
.settings-sub-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.settings-section {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}
.settings-section-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.settings-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.settings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.settings-table th,
.settings-table td {
    padding: 0.85rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.settings-table thead th {
    background: var(--bg-subtle);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.settings-table thead tr:first-child th:first-child {
    border-radius: 12px 0 0 0;
}
.settings-table thead tr:first-child th:last-child {
    border-radius: 0 12px 0 0;
}
.settings-table tbody tr {
    transition: background 0.15s;
}
.settings-table tbody tr:hover {
    background: var(--primary-light);
}
.settings-table tbody tr:last-child td {
    border-bottom: none;
}
.settings-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}
.settings-table tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}
.settings-user-name {
    font-weight: 500;
    color: var(--text);
}
.settings-role-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
}
.settings-role-admin {
    background: var(--primary-light);
    color: var(--primary);
}
.settings-role-operator {
    background: rgba(212, 168, 75, 0.18);
    color: #8a6d2a;
}
.settings-role-personel {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}
.settings-cell-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.settings-cell-actions .btn {
    margin: 0;
}
.settings-delete-form {
    display: inline;
}
.settings-you-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    width: 100%;
    max-width: 420px;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 95, 74, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(26, 95, 74, 0.35);
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #a83232;
    box-shadow: 0 2px 8px rgba(194, 61, 61, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}
.btn-sm:hover {
    transform: none;
}

/* Toplu işlem (Yaklaşan Aşılar) */
.toplu-islem-form {
    margin-bottom: 0;
}
.toplu-islem-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.toplu-islem-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.toplu-islem-ertele {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.toplu-islem-ertele label {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.toplu-islem-ertele select {
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.9rem;
}
.th-checkbox,
.td-checkbox {
    width: 2.5rem;
    text-align: center;
    vertical-align: middle;
}
.th-checkbox input[type="checkbox"],
.td-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ========== Alerts ========== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.alert-success {
    background: var(--success-soft);
    color: #1a6b52;
    border-color: rgba(45, 143, 111, 0.3);
}
.alert-danger {
    background: var(--danger-soft);
    color: #9e2a2a;
    border-color: rgba(194, 61, 61, 0.25);
}
.alert-warning {
    background: var(--warning-soft);
    color: #7a5a1a;
    border-color: rgba(196, 154, 46, 0.3);
}

/* ========== Due badges ========== */
.due-soon {
    color: var(--warning);
    font-weight: 600;
}
.due-overdue {
    color: var(--danger);
    font-weight: 600;
}

/* ========== Manual next date ========== */
.manual-next {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
}
.manual-next input[type="checkbox"] {
    width: auto;
    max-width: none;
    margin-right: 0.5rem;
    accent-color: var(--primary);
}
.manual-next .next-date-field {
    margin-top: 0.75rem;
}

/* Hayvan listesi – arama ve filtreleme (modern) */
.card-filter {
    border-left: 4px solid var(--primary);
    padding: 1.5rem 1.75rem;
}
.card-filter .filter-form { margin-bottom: 0; }
.filter-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.filter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
}
.card-filter h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}
.filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.filter-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 0.9fr auto;
    gap: 1rem;
    align-items: end;
}
.card-filter .input-wrap {
    margin-bottom: 0;
}
.card-filter .input-wrap input,
.card-filter .input-wrap select {
    width: 100%;
    max-width: none;
    padding: 0.6rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card-filter .input-wrap input:focus,
.card-filter .input-wrap select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.input-wrap-search input {
    padding-left: 0.875rem;
}
.filter-search { min-width: 0; }
.filter-field { min-width: 0; }
.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}
.btn-filter-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-filter-submit .btn-icon {
    font-size: 1rem;
    opacity: 0.9;
}
.filter-result-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 999px;
}
@media (max-width: 900px) {
    .filter-row {
        grid-template-columns: 1fr 1fr;
    }
    .filter-search { grid-column: span 2; }
    .filter-actions { grid-column: span 2; }
}
@media (max-width: 480px) {
    .filter-row { grid-template-columns: 1fr; }
    .filter-search { grid-column: span 1; }
    .filter-actions { grid-column: span 1; }
    .card-filter { padding: 1.25rem; }
}

/* Hayvan detay – evre ve yaş özeti */
.hayvan-evre-ozet {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}
.evre-badge {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}
.yas-gun {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Hayvan detay – bilgi tablosu */
.info-table { width: 100%; max-width: 480px; }
.info-table th { width: 140px; font-weight: 500; color: var(--text-secondary); }
.info-table td { padding: 0.35rem 0; }

/* Sıklık seçimi (özel / varsayılan) */
.siklik-secim { margin-top: 0.25rem; }
.siklik-radio { display: block; margin-bottom: 0.5rem; font-weight: 400; }
.siklik-radio input { width: auto; margin-right: 0.5rem; accent-color: var(--primary); }
.siklik-ozel-alan select { width: auto; margin-right: 0.5rem; }
.siklik-ozel-alan input[type="number"] { max-width: none; }

/* ========== Content links (card içi) ========== */
.card .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ========== Mobil görünüm ========== */
@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
    }
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: linear-gradient(180deg, var(--primary) 0%, #0d4a3a 100%);
        padding: 0.5rem 0 1rem;
        margin: 0 -1.5rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
        border-radius: 0 0 var(--radius) var(--radius);
        max-height: 70vh;
        overflow-y: auto;
        z-index: 101;
        gap: 0;
    }
    .header-inner.nav-open .nav {
        display: flex;
    }
    .nav a,
    .nav .header-user,
    .nav .header-logout {
        display: block;
        padding: 0.75rem 1.5rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    .nav .header-logout {
        margin: 0.5rem 1.5rem 0;
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: var(--radius-sm);
        justify-content: center;
    }
    .nav .notification-wrap {
        margin: 0;
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav .notification-bell {
        margin-left: 0;
    }
    .nav .header-user {
        margin-left: 0;
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav-overlay {
        display: block;
    }
    .header-inner.nav-open .nav-overlay.is-visible {
        display: block;
    }
    .logo {
        font-size: 1.1rem;
    }
}

@media (max-width: 900px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .nav {
        margin-left: -1rem;
        margin-right: -1rem;
    }
}

/* ========== Responsive (mevcut) ========== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .header-row {
        width: 100%;
    }
    .nav {
        justify-content: flex-start;
    }
    .stats {
        grid-template-columns: 1fr 1fr;
    }
    .card th,
    .card td {
        padding: 0.65rem 0.75rem;
        font-size: 0.9rem;
    }
    .actions {
        flex-direction: column;
    }
    .page-title {
        font-size: 1.35rem;
    }
    .card {
        padding: 1.25rem;
    }
    .btn {
        min-height: 44px;
        padding: 0.6rem 1rem;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1.25rem;
        padding: 0 1.25rem;
    }
    .table-responsive table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }
    .main {
        padding: 1rem 0 2rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0));
    }
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .card {
        padding: 1rem;
        border-radius: var(--radius-sm);
    }
    .card th,
    .card td {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
    .logo {
        font-size: 1rem;
    }
    .page-title {
        font-size: 1.2rem;
    }
}

/* Tabloları mobilde kaydırılabilir yap (card içinde tablo varsa) */
@media (max-width: 768px) {
    .card:has(> table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .card > .table-wrap,
    .card > div[style*="overflow"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    .card > table {
        min-width: 560px;
    }
}
