/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #1a1a2e;
    background: #f0f2f5;
    height: 100%;
}

a { color: #ef2626; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LOGIN ===== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2a0a0a 0%, #4a0e0e 50%, #ef2626 100%);
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #6c757d;
    margin-bottom: 24px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: #ef2626;
    box-shadow: 0 0 0 3px rgba(239, 38, 38, 0.1);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: #ef2626;
    color: #fff;
}

.btn-primary:hover { background: #d42020; }

.btn-success {
    background: #2ec4b6;
    color: #fff;
}

.btn-success:hover { background: #26a69a; }

.btn-danger {
    background: #ef476f;
    color: #fff;
}

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

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover { background: #5a6268; }

.btn-warning {
    background: #ffd166;
    color: #1a1a2e;
}

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

.btn-block {
    width: 100%;
    margin-top: 8px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2a0a0a;
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.sidebar-role {
    font-size: 11px;
    color: #fff7a9;
    background: rgba(239,38,38,0.15);
    padding: 2px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== SIDEBAR NAV ===== */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-nav .nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
    text-decoration: none;
}

.sidebar-nav .nav-item.active {
    color: #fff;
    background: rgba(239,38,38,0.15);
    border-left-color: #ef2626;
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.btn-lang {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.btn-lang:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.btn-logout {
    background: rgba(239,71,111,0.15);
    color: #ef476f;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ef476f;
    color: #fff;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
}

.content-body {
    padding: 24px 32px;
    max-width: 1400px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .stat-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-card .stat-sub {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* ===== DASHBOARD ENHANCED ===== */
.stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change span {
    font-weight: 400;
    color: #6c757d;
}

.change-up { color: #10b981; }
.change-down { color: #ef476f; }

.dashboard-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card { margin-bottom: 0; }

.chart-body {
    position: relative;
    height: 320px;
    padding: 16px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-actions .btn {
    padding: 14px 16px;
    font-size: 13px;
    justify-content: flex-start;
}

.dashboard-error {
    padding: 16px 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #b91c1c;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.coupon-usage {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.coupon-usage-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.coupon-usage-fill {
    height: 100%;
    background: #ef2626;
    border-radius: 3px;
    transition: width 0.3s;
}

.dashboard-date {
    font-size: 13px;
    color: #6c757d;
}

@media (max-width: 1024px) {
    .dashboard-charts { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
}

/* ===== CARD / PANEL ===== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 24px;
}

/* ===== TABLE ===== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eee;
    background: #fafbfc;
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

table tr:hover td {
    background: #f8f9fa;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #e5e7eb; color: #374151; }

/* ===== FORM ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: auto;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ef2626;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination .btn {
    min-width: 36px;
}

.pagination .page-info {
    font-size: 13px;
    color: #6c757d;
    margin: 0 8px;
}

/* ===== LOADING ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #6c757d;
    font-size: 14px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #495057;
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar .form-control {
    max-width: 300px;
}

.toolbar select.form-control {
    max-width: 200px;
}

/* ===== ORDER DETAIL ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.detail-item {
    margin-bottom: 12px;
}

.detail-item .detail-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item .detail-value {
    font-size: 15px;
    font-weight: 500;
}

/* ===== TREE (Categories) ===== */
.category-tree {
    list-style: none;
    padding: 0;
}

.category-tree .tree-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.category-tree .tree-item:hover {
    background: #f8f9fa;
}

.category-tree .tree-children {
    list-style: none;
    padding-left: 32px;
}

.tree-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.tree-item-actions {
    display: flex;
    gap: 8px;
}

/* ===== BLAZOR OVERRIDES ===== */
#blazor-error-ui {
    background: #b32121;
    color: #fff;
    padding: 12px 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    font-size: 13px;
}

#blazor-error-ui .reload {
    color: #ffd166;
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; font-size: 12px; margin-top: 4px; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "Bir hata olustu.";
}
