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

:root {
    /* 2027 Premium Light Mode Palette */
    --bg-app: #f4f6fa;
    --bg-card: rgba(255, 255, 255, 0.6);
    --bg-sidebar: rgba(255, 255, 255, 0.8);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    --brand-primary: #000000;      /* Apple-like minimalist black */
    --brand-accent: #0071e3;       /* Apple Blue */
    --brand-accent-hover: #0077ED;
    --brand-gradient: linear-gradient(135deg, #0071e3 0%, #4facfe 100%);
    
    --border-color: rgba(0, 0, 0, 0.05);
    --border-glass: rgba(255, 255, 255, 0.8);
    
    /* 2027 Bento Grid Radii */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-pill: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 24px rgba(0,0,0,0.06);
    --shadow-bento: 0 4px 24px -4px rgba(0,0,0,0.05), inset 0 0 0 1px rgba(255,255,255,0.4);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', sans-serif;
}

/* ================== RESET ================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    zoom: 80%;
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 125vh;
}
a { text-decoration: none; color: inherit; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ================== LAYOUT ================== */


/* SIDEBAR (Glassmorphism) */

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 24px;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    width: 32px; height: 32px;
    background: var(--brand-primary);
    color: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: bold;
}
.logo-text { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }

.sidebar-nav {
    padding: 24px 16px;
    padding-bottom: 120px; /* Ekstra boşluk (Mobil tarayıcı URL barı çakışmasını engellemek için) */
    flex-grow: 1;
    overflow-y: auto;
}
.nav-group { margin-bottom: 24px; }
.nav-label {
    font-size: 11px; font-weight: 600; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 1px; margin: 0 0 12px 16px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-weight: 500;
    transition: all 0.2s ease; margin-bottom: 4px;
}
.nav-item i { font-size: 18px; width: 24px; text-align: center; }
.nav-item:hover { background: rgba(0,0,0,0.03); color: var(--text-primary); }
.nav-item.active {
    background: var(--brand-primary);
    color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* CONTENT AREA */


.topbar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: transparent;
    z-index: 40;
}
.search-box {
    display: flex; align-items: center; gap: 12px;
    background: white; border-radius: var(--radius-pill);
    padding: 10px 24px; width: 320px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.search-box input { border: none; outline: none; font-size: 14px; width: 100%; font-family: var(--font-sans); }
.topbar-actions { display: flex; gap: 16px; align-items: center; }
.action-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: white; border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); cursor: pointer;
    box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.action-btn:hover { color: var(--brand-accent); border-color: var(--brand-accent); transform: scale(1.05); }

/* ================== BENTO GRID (2027 STYLE) ================== */
.main-content { padding: 0 40px 40px; }
.page-header { margin-bottom: 32px; }
.page-title { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -1px; }
.page-subtitle { color: var(--text-secondary); font-size: 16px; margin-top: 4px; }

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(120px, auto);
    gap: 24px;
}

/* Bento Box Base */
.bento-box {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: var(--shadow-bento);
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.bento-box:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

/* Specific Bento Sizes */
.bento-hero { grid-column: span 8; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; background: var(--brand-gradient); color: white; border: none; }
.bento-hero h2 { font-family: var(--font-display); font-size: 40px; margin-bottom: 12px; }
.bento-hero p { font-size: 18px; opacity: 0.9; max-width: 80%; }

.bento-stat { grid-column: span 4; display: flex; flex-direction: column; justify-content: center; }
.stat-value { font-family: var(--font-display); font-size: 48px; font-weight: 700; color: var(--brand-primary); line-height: 1; margin-bottom: 8px; }
.stat-label { color: var(--text-secondary); font-size: 15px; font-weight: 500; }

.bento-tool { grid-column: span 3; grid-row: span 2; display: flex; flex-direction: column; cursor: pointer; }
.bento-tool .tool-icon {
    width: 64px; height: 64px; border-radius: var(--radius-md);
    background: white; display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin-bottom: auto; box-shadow: var(--shadow-sm);
}
.bento-tool.pdf .tool-icon { color: #ef4444; }
.bento-tool.word .tool-icon { color: #2563eb; }
.bento-tool.excel .tool-icon { color: #16a34a; }
.bento-tool.iban .tool-icon { color: #8b5cf6; }

.bento-tool h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 20px 0 8px; }
.bento-tool p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }

.bento-wide { grid-column: span 6; }

/* Responsive Grid */
@media (max-width: 1200px) {
    .bento-tool { grid-column: span 4; }
}

@media (max-width: 900px) {
    .bento-hero { grid-column: span 12; }
    .bento-stat { grid-column: span 6; }
    .bento-tool { grid-column: span 6; }
    .bento-wide { grid-column: span 12; }
    
    .sidebar { position: fixed; top: 0; left: 0; height: 125vh; transform: translateX(-100%); z-index: 1000; margin-top: 0; }

    .sidebar.active { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,0.5); }
    .content-wrapper { margin-left: 0; width: 100%; }
    .topbar { padding: 0 20px; }
    .main-content { padding: 0 20px 20px; }
    .mobile-menu-btn { display: flex !important; }
}

@media (max-width: 600px) {
    .bento-stat { grid-column: span 12; }
    .bento-tool { grid-column: span 12; }
    .bento-hero h2 { font-size: 28px; }
    .bento-hero p { font-size: 15px; max-width: 100%; }
    
    .topbar { flex-direction: column; height: auto; padding: 15px 20px; gap: 15px; align-items: stretch; }
    .search-box { width: 100%; order: 2; }
    .topbar-actions { order: 1; justify-content: space-between; width: 100%; }
    .user-menu { flex-wrap: wrap; justify-content: flex-end; }
    .hide-on-mobile { display: none !important; } /* Hide user name text on very small screens to save space */

    /* Forms and grids fix for mobile */
    .tapu-grid { grid-template-columns: 1fr !important; }
    .upload-form { padding: 20px !important; }
    .file-input { max-width: 100% !important; }
    .bento-box { padding: 20px; }
    .page-title { font-size: 28px; }
    
    /* Portal pages fix for mobile */
    .portal-article-container { flex-direction: column; }
    .portal-sidebar { width: 100% !important; border-right: none !important; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--brand-primary); color: white;
    align-items: center; justify-content: center;
    border: none; cursor: pointer;
    font-size: 20px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 45;
    backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

/* ================== UI COMPONENTS ================== */
.btn {
    padding: 12px 24px; border-radius: var(--radius-pill);
    font-family: var(--font-sans); font-size: 15px; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.3s;
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn-primary { background: var(--brand-primary); color: white; }
.btn-primary:hover { transform: scale(1.02); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-white { background: white; color: var(--brand-primary); }
.btn-white:hover { transform: scale(1.02); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* Responsive Tables for Admin & Feedbacks */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
}
.table-responsive table.admin-table {
    min-width: 700px; /* Forces horizontal scroll on mobile instead of squishing */
    width: 100%;
}

/* Ultra Wide Screen / TV Fix */
@media (min-width: 1600px) {
    .main-content {
        max-width: 1500px;
        margin: 0 auto;
    }
    .topbar {
        max-width: 1500px;
        margin: 0 auto;
        width: 100%;
    }
}


/* Fix Toast overlap with Banner */
.swal2-container.swal2-top-end, .swal2-container.swal2-top-right {
    top: 60px !important;
}


.app-container {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    min-height: 100vh; /* Will be overridden by flex if body is 125vh */
    width: 100%;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 125vh;
    overflow-y: auto;
    padding-top: 24px;
    z-index: 50;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex children from overflowing */
}
