:root {
    --primary-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --danger-grad: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    --success-grad: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-gradient-primary {
    background: var(--primary-grad);
    border: none;
    color: white;
    transition: 0.3s;
}

.btn-gradient-danger {
    background: var(--danger-grad);
    border: none;
    color: white;
    transition: 0.3s;
}

.btn-gradient-success {
    background: var(--success-grad);
    border: none;
    color: white;
    transition: 0.3s;
}

.btn-gradient-primary:hover,
.btn-gradient-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

.glass-card {
    background: white;
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.doc-preview {
    width: 100px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.doc-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    z-index: 10;
    border: 2px solid #667eea;
}

.card.glass-card {
    position: relative;
    /* Checkbox'ın kart içinde hizalanması için */
    transition: all 0.3s ease;
}

.card.selected-card {
    border: 2px solid #667eea;
    background-color: rgba(102, 126, 234, 0.05);
}

#action-buttons {
    display: none;
    /* JS ile kontrol edilecek */
    gap: 10px;
}

.loading-text {
    display: inline-block;
    background: linear-gradient(90deg, #00f, #0ff, #00f) -100%/ 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    font-size: clamp(0.5rem, 5vw, 1.2rem);
    animation: shimmer 10s linear infinite;
    vertical-align: middle;
}

@keyframes shimmer {
    to {
        background-position: 100%
    }
}

@media (forced-colors: active) {
    .loading-text {
        background: none;
        color: Highlight;
    }
}

/* ============================
   EVRAK META (NİHAİ REVİZE)
   - 2 satır: (Sayfa|Boyut) ve (Veriliş|Bitiş)
   - Dar alanda alt alta düşer
   - Taşma yapmaz
   ============================ */

/* Ayırıcı çizgi */
.doc-sep {
    margin: 10px 8px 8px;
    opacity: .15;
}

/* Ana konteyner */
.doc-meta-grid {
    width: 100%;
    min-width: 0;
    /* flex/grid içindeyken taşmayı engeller */
    padding: 0 8px 8px;
    font-size: 12px;
    line-height: 1.25;
    color: #444;

    /* Eğer temada global writing-mode vb. varsa ez */
    writing-mode: horizontal-tb !important;
    transform: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

/* Satır: 2 kolon */
.doc-meta-grid .meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 6px;
}

/* ===== META hücre kırılma düzeltmesi (tarih bozulmasını bitirir) ===== */
.doc-meta-grid .meta-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
    /* dar alanda alt satıra düşebilsin */
}

/* ikon */
.doc-meta-grid .meta-ico {
    flex: 0 0 auto;
    line-height: 1;
}

/* label kısmı: "Veriliş:" "Bitiş:" vs -> ASLA bölünmesin */
.doc-meta-grid .meta-lbl {
    flex: 0 0 auto;
    white-space: nowrap;
    font-weight: 700;
    color: #212529;
}

/* değer kısmı: tarih/boyut -> normalde tek satır kalsın */
.doc-meta-grid .meta-val {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* çok dar alanda taşarsa: değer alt satıra geçsin, ama label bölünmesin */
@media (max-width: 420px) {
    .doc-meta-grid .meta-val {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}