/* 
   YESME Bilisim - Ucelmas Stock Premium Theme
   Modern, State-of-the-art Inventory Management UI
*/

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

:root {
    /* Primary Color Palette (Deep Azure / Sapphire) */
    --primary: #0061ff;
    --primary-dark: #004ecc;
    --primary-light: #e6f0ff;
    
    /* Surface Colors */
    --bg-main: #f8fafc;
    --bg-sidebar: #0f172a; /* Slate 900 */
    --surface: #ffffff;
    --glass: rgba(255, 255, 255, 0.85);
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    /* Feedback Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* Global Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout Implementation */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-white);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-logo span {
    color: var(--primary);
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

.nav-link.active {
    background: var(--primary);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(0, 97, 255, 0.3);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

header.top-bar {
    height: var(--header-height);
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* UI Elements */
.card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input[type="text"], 
input[type="password"], 
input[type="number"], 
input[type="date"], 
select, 
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 97, 255, 0.2);
}

/* GridView / Table Styling */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: var(--bg-main);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: #f8fafc;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.stat-card .label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--primary);
}

/* Badges */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-in { background: #ecfdf5; color: #059669; }
.badge-out { background: #fef2f2; color: #dc2626; }

/* Login Page Specifics */
.login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-header-text {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.login-header-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-header-text h1 span {
    color: var(--primary);
}

/* Utility Classes for Responsive Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    display: block;
}
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #d1fae5; }

/* Responsive Fixes */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    /* Sidebar Overlay */
    .sidebar.open::after {
        content: '';
        position: fixed;
        top: 0;
        left: var(--sidebar-width);
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    header.top-bar {
        padding: 0 1rem;
    }

    .container {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4, .grid-auto {
        grid-template-columns: 1fr !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1rem;
    }

    .top-bar .page-title h1 {
        font-size: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Form within grid overrides */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Special padding for the dashed area in Purchases */
    div[style*="padding: 2rem"] {
        padding: 1rem !important;
    }
}

/* Print Styles */
@media print {
    .sidebar, .top-bar, .btn {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .card {
        box-shadow: none;
        border: 1px solid #eee;
    }
}
