/* === TarlaDefteri.Com - Ana Stil Dosyası === */
:root {
    --primary: #2e7d32;
    --primary-light: #4caf50;
    --primary-dark: #1b5e20;
    --accent: #ff8f00;
    --bg: #f5f7f5;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --sidebar-width: 240px;
    --navbar-height: 56px;
    --bottomnav-height: 64px;
}

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    margin: 0;
    padding: 0;
}

body.has-bottomnav {
    padding-top: var(--navbar-height);
    padding-bottom: var(--bottomnav-height);
}

/* === Navbar === */
.navbar { height: var(--navbar-height); z-index: 1040; }
.navbar-brand { font-size: 1.15rem; }

/* === Sidebar (Desktop) === */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    z-index: 1030;
    background: #fff;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: rgba(46, 125, 50, 0.1);
    color: var(--primary);
}

/* === Main Content === */
.main-content {
    margin-top: 0;
}

@media (min-width: 992px) {
    .main-content { margin-left: var(--sidebar-width); }
}

/* === Bottom Nav (Mobil) === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottomnav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1040;
    background: #fff;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 0.6rem;
    padding: 4px 2px;
    min-width: 0;
    flex: 1;
    transition: color 0.15s;
}

.bottom-nav-item i { font-size: 1.15rem; margin-bottom: 1px; }
.bottom-nav-item:hover, .bottom-nav-item.active {
    color: var(--primary);
}

/* === Offcanvas Mobil Menü === */
#mobilMenu {
    z-index: 1060;
}

#mobilMenu + .offcanvas-backdrop,
.offcanvas-backdrop {
    z-index: 1055;
}

.offcanvas-nav .nav-link {
    color: #333;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.offcanvas-nav .nav-link:hover,
.offcanvas-nav .nav-link.active {
    background: rgba(46, 125, 50, 0.1);
    color: var(--primary);
}

.offcanvas-nav .nav-link i {
    width: 1.5rem;
    text-align: center;
}

/* === Cards === */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s;
}

.card:hover { transform: translateY(-1px); }

.stat-card {
    border-left: 4px solid var(--primary);
    background: #fff;
}

.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.warning { border-left-color: var(--accent); }
.stat-card.warning .stat-number { color: var(--accent); }
.stat-card.danger { border-left-color: #d32f2f; }
.stat-card.danger .stat-number { color: #d32f2f; }
.stat-card.info { border-left-color: #1976d2; }
.stat-card.info .stat-number { color: #1976d2; }

/* === Buttons === */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-fab {
    position: fixed;
    bottom: calc(var(--bottomnav-height) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1045;
}

@media (min-width: 992px) {
    .btn-fab { bottom: 24px; right: 24px; }
}

/* === Forms === */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(46,125,50,0.15);
}

/* === Search === */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 24px;
    background: #fff;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* === List Items === */
.list-item {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.list-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    color: inherit;
}

/* === Badges === */
.badge-durum-planli { background: #1976d2; }
.badge-durum-tamamlandi { background: #2e7d32; }
.badge-durum-iptal { background: #757575; }
.badge-odeme-bekliyor { background: #ff8f00; }
.badge-odeme-kismi { background: #f57c00; }
.badge-odeme-odendi { background: #2e7d32; }
.badge-odeme-gecikti { background: #d32f2f; }

/* === Page Header === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-header h4 {
    margin: 0;
    font-weight: 700;
    color: #333;
}

/* === Login Page === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.login-card .logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-card .logo i { font-size: 3rem; color: var(--primary); }
.login-card .logo h3 { color: var(--primary-dark); font-weight: 700; }

/* === Giriş Sayfası İletişim Linki === */
.giris-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(46,125,50,0.08), rgba(76,175,80,0.12));
    border: 1px solid rgba(46,125,50,0.2);
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.giris-contact-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(46,125,50,0.25);
}
.giris-contact-link i { font-size: 1rem; }

/* === Map === */
#harita {
    height: 300px;
    border-radius: 12px;
    z-index: 1;
}

/* === Photo Grid === */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.photo-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s;
}

.photo-grid img:hover { transform: scale(1.03); }

/* === Utilities === */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.empty-state i { font-size: 3rem; margin-bottom: 1rem; }

/* === Aranabilir Select === */
.arama-select-wrapper {
    position: relative;
}

.arama-select-display {
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'%3e%3cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
}

.arama-select-display:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.15);
}

.arama-select-dropdown {
    animation: aramaFadeIn 0.15s ease;
}

@keyframes aramaFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.arama-select-item:last-child {
    border-bottom: none !important;
}

/* === Detay Tab Panelleri === */
#detayTablar {
    border-bottom: 2px solid #e9ecef;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#detayTablar::-webkit-scrollbar { display: none; }

#detayTablar .nav-link {
    white-space: nowrap;
    color: #666;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.6rem 0.8rem;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    transition: color 0.2s, border-color 0.2s;
}

#detayTablar .nav-link:hover { color: var(--primary); }

#detayTablar .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

@media (max-width: 576px) {
    #detayTablar .nav-link { padding: 0.5rem 0.6rem; font-size: 0.82rem; }
    #detayTablar .nav-link .d-none { display: none !important; }
    #konumDegistirHarita, #detayHarita { height: 250px !important; }
}
