/* TUGAYLAR ERP - DESIGN SYSTEM (Blueprint V9.6 - Consolidated Stability)
   Elite ERP Framework - Global Stylesheet 
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    /* --- Ana Renk Paleti --- */
    --n-bg: #fcfbf9;           /* Kemik / Gövde Arka Plan */
    --n-primary: #1b1f22;      /* Koyu Antrasit / Ana Metin ve Buton */
    --n-bone-light: #fcfbf9;   /* Input İç Arka Plan */
    --n-bone-dark: #f8f7f4;    /* Sidebar ve Kart Arka Planları */
    --n-muted: #5a5c5e;        /* Yardımcı Metinler */
    --n-white: #ffffff;
    
    /* --- Tipografi Standartları --- */
    --fs-h1: 22px;
    --fs-h2: 18px;
    --fs-h3: 15px;
    --fs-caption: 11px;
    --fs-body: 13px;
    
    /* --- Köşe Keskinliği (Radius) --- */
    --radius-sharp: 2px;       /* 🚀 ANA KURAL: Keskin Hatlar */
    --radius-full: 9999px;
    
    /* --- Ölçü Standartları --- */
    --h-btn-main: 44px;        /* Ana aksiyon butonları */
    --h-btn-ui: 40px;          /* 🚀 MOBİL/TOOLBAR STANDART */
    
    /* --- Çerçeve ve Çizgiler --- */
    --n-border: rgba(27, 31, 34, 0.10);
    --n-border-strong: rgba(27, 31, 34, 0.20);
    
    /* --- Semantik Renkler --- */
    --c-success: #3c8a64;
    --c-success-bg: #E9FAF1;
    --c-danger: #991b1b;
    --c-danger-bg: #FEE2E2;
    --c-warning: #9a3412;
    --c-warning-bg: #FFEDD5;

    /* --- Geçişler --- */
    --n-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BASE RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Montserrat', sans-serif; -webkit-font-smoothing: antialiased; }

/* Modal Açıkken Kaydırmayı Kilitle */
body.n-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* --- 🛡️ LAYOUT SHIELD (V17.5 Ghost Header Fix) --- */
#erp-shell {
    height: 100dvh !important; /* Dinamik yükseklik: iPhone barlarını ezer */
    display: flex;
    overflow: hidden;
    width: 100%;
    background-color: var(--n-bg);
}

#main-wrapper { 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
    min-width: 0; 
    height: 100%; 
    position: relative;
    overflow: hidden; 
}

header {
    height: 80px;
    background: #fff;
    border-bottom: 1px solid var(--n-border);
    flex-shrink: 0 !important; 
    z-index: 40; /* Drawer ve Overlay'in altında kalması için 40'a çekildi */
    position: relative;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0,0,0);
}

#main-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 10;
}

/* Mobilde Header'ı Çivile */
@media (max-width: 768px) {
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
    }
    #main-content {
        padding-top: 80px;
    }
}

/* --- 🚀 Z-INDEX HIERARCHY (Elite Layers) --- */
[id$="_overlay"] { z-index: 900 !important; } /* Siyah perde Header üstüne */
[id$="_box"]      { z-index: 910 !important; } /* Drawer kutusu */
.n-modal-container { z-index: 9999 !important; } /* Modallar en tepeye */

/* --- TYPOGRAPHY --- */
.h1-std { font-weight: 800; font-size: var(--fs-h1); text-transform: uppercase; letter-spacing: 2.5px; display: flex; align-items: center; gap: 12px; }
.h2-std { font-weight: 700; font-size: var(--fs-h2); text-transform: uppercase; letter-spacing: 1.5px; }
.h3-std { font-weight: 700; font-size: var(--fs-h3); text-transform: uppercase; letter-spacing: 1px; }
.h3-soft { font-weight: 600; font-size: var(--fs-h3); letter-spacing: -0.3px; color: var(--n-primary); }
.caption-std { font-weight: 700; font-size: var(--fs-caption); color: var(--n-muted); text-transform: uppercase; letter-spacing: 1.5px; }
.body-std { font-size: var(--fs-body); font-weight: 500; line-height: 1.6; }

/* --- BUTTON SYSTEM --- */
.n-btn {
    height: var(--h-btn-main);
    padding: 0 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: var(--radius-sharp);
    transition: all var(--n-transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
}

.n-btn:active:not(:disabled) { transform: scale(0.97); }

.n-btn-primary { background: var(--n-primary); color: var(--n-white); }
.n-btn-primary:hover:not(:disabled) { background: #000; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.n-btn-secondary { background: transparent; border-color: var(--n-border-strong); color: var(--n-primary); }
.n-btn-secondary:hover:not(:disabled) { background: var(--n-bone-dark); border-color: rgba(27, 31, 34, 0.3); }

.n-btn-ghost { background: transparent; color: var(--n-muted); }
.n-btn-ghost:hover:not(:disabled) { background: rgba(0,0,0,0.05); color: var(--n-primary); }

.n-btn-danger { background: var(--c-danger); color: var(--n-white); }
.n-btn-success { background: var(--c-success); color: var(--n-white); }

.n-btn-ui { height: var(--h-btn-ui); padding: 0 16px; font-size: 10px; }
.n-btn-icon { width: 44px; padding: 0; border-color: var(--n-border); }

.n-btn-link {
    background: transparent; color: var(--n-muted); height: 32px; padding: 0 12px; border: none;
    text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(90, 92, 94, 0.3);
}
.n-btn-link:hover:not(:disabled) { color: var(--n-primary); transform: translateY(-1px); }

.n-page-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--n-border); border-radius: var(--radius-sharp);
    background: var(--n-white); color: var(--n-primary); font-size: 11px; font-weight: 700; cursor: pointer;
}
.n-page-btn.is-active { background: var(--n-primary); color: var(--n-white); border-color: var(--n-primary); }

/* --- FORM COMPONENTS --- */
.n-input, .n-textarea {
    width: 100%;
    background-color: var(--n-bone-light);
    border: 1px solid var(--n-border);
    border-radius: var(--radius-sharp);
    padding: 12px 16px;
    font-size: var(--fs-body);
    font-weight: 600;
    outline: none;
    transition: var(--n-transition);
}
.n-input:focus, .n-textarea:focus { border-color: var(--n-primary); background: #fff; box-shadow: 0 0 0 2px rgba(27, 31, 34, 0.05); }

/* --- AVATAR / PROFIL --- */
.n-avatar {
    background-color: var(--n-primary); color: var(--n-white);
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sharp); font-weight: 800; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- KANBAN & CARDS --- */
.kanban-card {
    background: var(--n-white); border: 1px solid var(--n-border); border-radius: 4px;
    transition: var(--n-transition); cursor: grab;
}
.kanban-card:hover { border-color: var(--n-primary); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }

/* --- CUSTOM SCROLLBAR --- */
.custom-scrollbar::-webkit-scrollbar { width: 4px; height: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

/* --- OS NATIVE KILLER --- */
select, input[type="date"], input[type="datetime-local"] {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    border-radius: 2px !important; background-color: var(--n-bone-light);
    color: var(--n-primary) !important; outline: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(0,0,0,0.3)'%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 12px center; background-size: 16px;
    padding-right: 40px !important;
}
select:focus, input[type="date"]:focus { border-color: var(--n-primary); box-shadow: 0 0 0 1px var(--n-primary); }

/* --- ANIMATIONS --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.animate-fade { animation: fadeIn 0.3s ease-out forwards; }
.animate-scale { animation: scaleIn 0.2s ease-out forwards; }

/* --- MOBİL TABLO UX --- */
@media (max-width: 768px) {
    .overflow-x-auto { -webkit-overflow-scrolling: touch; }
    .n-table-container td { min-height: 50px; }
}