/* assets/css/style.css - Ali Şafak Otomotiv Full-Width Responsive B2B Design System */

:root {
    --color-dark: #191919;
    --color-dark-light: #252525;
    --color-red: #e91e27;
    --color-red-hover: #c6131b;
    --color-white: #ffffff;
    --color-bg: #f4f6f9;
    --color-card: #ffffff;
    
    --color-text-main: #2b2b2b;
    --color-text-muted: #6c757d;
    --color-border: #e2e8f0;

    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #0284c7;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);

    --transition: all 0.2s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    overflow-x: hidden;
}

/* App Container - Full Width */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Mobile Top Navbar */
.mobile-topbar {
    display: none;
    height: 60px;
    background: var(--color-dark);
    color: var(--color-white);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mobile-topbar img {
    height: 38px;
    object-fit: contain;
}

.mobile-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
}

/* Sidebar - Collapsible on Mobile */
.sidebar {
    width: 260px;
    background: var(--color-dark);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px 20px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar-brand img {
    max-width: 180px;
    max-height: 55px;
    object-fit: contain;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #b0b0b0;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-item a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active a {
    color: #ffffff;
    background: var(--color-red);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(233, 30, 39, 0.3);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
}

.user-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.user-info p {
    font-size: 11px;
    color: #888888;
}

/* Main Content Area - Full Width Fluid Screen */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 24px 28px;
    width: calc(100% - 260px);
    box-sizing: border-box;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: var(--color-white);
    padding: 18px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 16px;
}

.page-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-dark);
    letter-spacing: -0.3px;
}

.page-title p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Grid System - Responsive */
.grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }

/* Stat Cards */
.stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-top: 3px solid var(--color-dark);
}

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

.stat-card.accent-red { border-top-color: var(--color-red); }
.stat-card.accent-emerald { border-top-color: var(--color-success); }
.stat-card.accent-amber { border-top-color: var(--color-warning); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.icon-blue { background: #e0f2fe; color: #0284c7; }
.icon-emerald { background: #d1fae5; color: #059669; }
.icon-rose { background: #ffe4e6; color: var(--color-red); }
.icon-amber { background: #fef3c7; color: #d97706; }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-dark);
    letter-spacing: -0.5px;
}

.stat-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Card & Tables */
.card-table {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    width: 100%;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-dark);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
}

th {
    background: #f1f5f9;
    padding: 12px 18px;
    color: var(--color-dark);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main);
    vertical-align: middle;
}

tr:nth-child(even) td {
    background: #fafcfd;
}

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

tr:hover td {
    background: #f1f5f9;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.badge-danger { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }
.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--color-red);
    color: #fff;
    box-shadow: 0 2px 6px rgba(233, 30, 39, 0.25);
}

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

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #ffffff;
    color: var(--color-dark);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-dark {
    background: var(--color-dark);
    color: #ffffff;
}

.btn-dark:hover {
    background: #333333;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-main);
    font-size: 13px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px rgba(233, 30, 39, 0.12);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 16px;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-10px);
    transition: transform 0.2s ease;
}

.modal-backdrop.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-red);
}

.modal-header h3 {
    font-size: 17px;
    color: var(--color-dark);
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
}

/* Products Grid */
.product-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-red);
}

.product-img {
    height: 180px;
    width: 100%;
    object-fit: cover;
    background: #f8fafc;
}

.product-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-red);
    text-transform: uppercase;
}

.product-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-dark);
    margin: 4px 0 6px 0;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-dark);
    margin-top: auto;
    padding-top: 10px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success { background: #d1fae5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-danger { background: #ffe4e6; border: 1px solid #fecdd3; color: #9f1239; }

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .mobile-topbar { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        top: 60px;
        height: calc(100vh - 60px);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 76px 16px 24px 16px;
    }
    .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
    .top-bar { flex-direction: column; align-items: flex-start; }
    .top-bar > div:last-child { width: 100%; display: flex; flex-direction: column; }
    .top-bar .btn { width: 100%; }
}
