﻿/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

/* =====================================================
   ADMIN LAYOUT
   ===================================================== */
.admin-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f5f3;
    min-height: 0;
    min-width: 0;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.admin-sidebar {
    width: 220px;
    background: #1a1f2e;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
}

.sidebar-logo {
    padding: 20px;
    border-bottom: 0.5px solid rgba(255,255,255,0.08);
}

.logo-text {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}

.logo-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 20px 6px;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 13.5px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

    .nav-item:hover {
        color: rgba(255,255,255,0.9);
        background: rgba(255,255,255,0.05);
    }

    .nav-item.active {
        color: #fff !important;
        background: rgba(99,130,255,0.15);
        border-left-color: #6382ff;
    }

    .nav-item i {
        font-size: 17px;
    }

/* =====================================================
   TOPBAR
   ===================================================== */
.admin-topbar {
    background: #fff;
    border-bottom: 0.5px solid #e5e5e2;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a2e;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #6382ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
}

/* =====================================================
   CONTENT AREA
   ===================================================== */
.admin-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

    .page-header h1 {
        font-size: 18px;
        font-weight: 600;
        color: #1a1a2e;
        margin: 0 0 3px 0;
    }

    .page-header p {
        font-size: 13px;
        color: #6b7280;
        margin: 0;
    }

/* =====================================================
   DASHBOARD
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 0.5px solid #e5e5e2;
    border-radius: 10px;
    padding: 16px;
    position: relative;
}

.stat-icon {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 22px;
    opacity: 0.15;
}

.stat-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
}

.stat-delta {
    font-size: 11px;
    margin-top: 4px;
}

    .stat-delta.up {
        color: #3B6D11;
    }

    .stat-delta.down {
        color: #A32D2D;
    }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
}

.card {
    background: #fff;
    border: 0.5px solid #e5e5e2;
    border-radius: 10px;
    padding: 16px 20px;
    overflow: hidden;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 14px;
    color: #333;
}

/* =====================================================
   TAB BAR
   ===================================================== */
.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1.5px solid #e5e7eb;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1.5px;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

    .tab-btn i {
        font-size: 15px;
    }

    .tab-btn:hover {
        color: #374151;
    }

    .tab-btn.active {
        color: #6366f1;
        border-bottom-color: #6366f1;
        font-weight: 600;
    }

/* =====================================================
   TOOLBAR
   ===================================================== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    padding: 0 12px;
    height: 38px;
    flex: 1;
    max-width: 360px;
    transition: border-color 0.15s;
}

    .search-box:focus-within {
        border-color: #6366f1;
    }

    .search-box i {
        color: #9ca3af;
        font-size: 16px;
        flex-shrink: 0;
    }

    .search-box input {
        border: none;
        outline: none;
        background: transparent;
        font-size: 13px;
        color: #1a1a2e;
        width: 100%;
    }

        .search-box input::placeholder {
            color: #c4c9d4;
        }

.filter-select {
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

    .filter-select:focus {
        border-color: #6366f1;
    }

/* =====================================================
   TABLE
   ===================================================== */
.table-wrap {
    background: #fff;
    border: 0.5px solid #e5e5e2;
    border-radius: 010px;
    overflow: hidden;
}

    .table-wrap table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

    .table-wrap thead tr {
        background: #f9f9f7;
        border-bottom: 1px solid #e5e5e2;
    }

    .table-wrap th {
        padding: 10px 14px;
        text-align: left;
        font-size: 11px;
        font-weight: 600;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        white-space: nowrap;
    }

    .table-wrap td {
        padding: 11px 14px;
        border-bottom: 0.5px solid #f0f0ee;
        color: #374151;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
        vertical-align: middle;
    }

    .table-wrap tr:last-child td {
        border-bottom: none;
    }

    .table-wrap tbody tr:hover td {
        background: #fafaf8;
    }

.table-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* Dashboard card table */
.card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.card th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 0.5px solid #e5e5e2;
}

.card td {
    padding: 10px 12px;
    border-bottom: 0.5px solid #f0f0ee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.card tr:last-child td {
    border-bottom: none;
}

.card tr:hover td {
    background: #fafaf8;
}

/* =====================================================
   TRACK ID
   ===================================================== */
.track-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    padding: 2px 7px;
    color: #374151;
    white-space: nowrap;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green {
    background: #46fb49;
    color: #065f46;
    padding: 7px 12px;
    border-bottom: 0.5px solid #f0f0ee;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    vertical-align: middle;
    font-size: 12px;
}

.badge-amber {
    background: #fef3c7;
    color: #92400e;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}
.badge-gray {
    background: #f3f4f6;
    color: #6b7280;
}

/* =====================================================
   ROW ACTIONS
   ===================================================== */
.row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 15px;
    padding: 0;
    transition: background 0.15s;
    text-decoration: none;
}

    .action-btn.edit {
        background: #eff6ff;
        color: #3b82f6;
        display: flex;
        width: 60px;
        height: 30px;
        padding: 11px 14px;
        border-bottom: 0.5px solid #f0f0ee;
        color: #374151;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
        vertical-align: middle;
        font-size: 12px;
    }

        .action-btn.edit:hover {
            background: #dbeafe;
            color: #1d4ed8;
        }

    .action-btn.delete {
        background: #fff1f2;
        color: #ef4444;
        display: flex;
        width: 60px;
        height: 30px;
        padding: 11px 14px;
        border-bottom: 0.5px solid #f0f0ee;
        color: #374151;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
        vertical-align: middle;
        font-size: 12px;
    }

        .action-btn.delete:hover {
            background: #fee2e2;
            color: #b91c1c;
        }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 0.5px solid #e5e5e2;
    font-size: 12px;
    color: #9ca3af;
    background: #fafafa;
}

.page-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .page-btn:hover:not(:disabled):not(.active) {
        background: #f3f4f6;
    }

    .page-btn.active {
        background: #6366f1;
        border-color: #6366f1;
        color: #fff;
        font-weight: 700;
    }

    .page-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

/* =====================================================
   SEARCH PANEL
   ===================================================== */
.search-panel {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-panel-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

    .search-panel-row .search-box {
        flex: 1;
        max-width: 100%;
    }

/* =====================================================
   DETAIL CARD
   ===================================================== */
.detail-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    padding: 11px 16px;
    border-bottom: 0.5px solid #f0f0ee;
    font-size: 13px;
    gap: 16px;
}

    .detail-row:last-of-type {
        border-bottom: none;
    }

    .detail-row > span:first-child {
        width: 120px;
        flex-shrink: 0;
        color: #9ca3af;
        font-size: 12px;
        font-weight: 500;
    }

    .detail-row > span:last-child {
        color: #1a1a2e;
        font-weight: 500;
        word-break: break-word;
    }

.detail-actions {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: #f8f9fb;
    border-top: 1px solid #e5e7eb;
}

/* =====================================================
   RESULT INFO
   ===================================================== */
.result-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #0c4a6e;
    flex-wrap: wrap;
}

    .result-info i {
        margin-right: 3px;
        color: #0284c7;
    }

.result-count {
    margin-left: auto;
    font-weight: 700;
    color: #0369a1;
    background: #bae6fd;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}

    .btn-primary:hover:not(:disabled) {
        background: #4f46e5;
        color: #fff;
    }

    .btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

    .btn-secondary:hover {
        background: #e5e7eb;
    }

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

    .btn-danger:hover:not(:disabled) {
        background: #dc2626;
    }

    .btn-danger:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* =====================================================
   ALERT
   ===================================================== */
.alert-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    padding: 10px 14px;
    color: #be123c;
    font-size: 13px;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

    .form-group label {
        font-size: 11.5px;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 9px 12px;
        border: 1.5px solid #e5e7eb;
        border-radius: 8px;
        font-size: 13px;
        color: #1a1a2e;
        background: #fff;
        outline: none;
        font-family: inherit;
        transition: border-color 0.15s;
    }

        .form-group input:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            border-color: #6366f1;
        }

    .form-group textarea {
        resize: vertical;
    }

.form-group-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

    .form-group-check input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: #6366f1;
        cursor: pointer;
    }

    .form-group-check label {
        font-size: 13px;
        font-weight: 500;
        color: #374151;
        cursor: pointer;
    }

/* =====================================================
   INLINE EDIT / DELETE
   ===================================================== */
.inline-edit {
    padding: 16px;
    background: #f5f5ff;
    border-radius: 8px;
}

.inline-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.inline-edit .form-group {
    margin-bottom: 0;
}

.inline-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.editing-row > td {
    background: #f5f5ff !important;
    padding: 10px 14px !important;
}

.deleting-row > td {
    background: #fff5f5 !important;
}

/* =====================================================
   MODAL (hazır, ileride kullanmak istersen)
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 480px;
    max-width: 95vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
    z-index: 10000;
}

.modal-sm {
    width: 360px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 0.5px solid #e5e5e2;
    font-size: 15px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 18px;
    display: flex;
    align-items: center;
}

    .modal-close:hover {
        color: #333;
    }

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 0.5px solid #e5e5e2;
}
.table-actions{
    display:flex;
    gap:10px;
    justify-content:flex-end;
}

.action-btn{
    width:38px;
    height:38px;
    border:none;
    border-radius:10px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    transition:.2s;
}

.edit-btn{
    background:#2563eb;
    color:white;
}

.edit-btn:hover{
    transform:scale(1.05);
}

.delete-btn{
    background:#dc2626;
    color:white;
}

.delete-btn:hover{
    transform:scale(1.05);
}

.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:999;
}

.modal{
    width:420px;
    background:white;
    border-radius:18px;
    overflow:hidden;
}

.modal-header{
    padding:18px 22px;
    border-bottom:1px solid #eee;
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:18px;
    font-weight:700;
}

.modal-close{
    border:none;
    background:none;
    font-size:20px;
    cursor:pointer;
}

.modal-body{
    padding:22px;
    display:flex;
    flex-direction:column;
    gap:18px;
}

.form-group{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.form-group input{
    height:45px;
    border:1px solid #ddd;
    border-radius:10px;
    padding:0 14px;
    outline:none;
}

.checkbox-group{
    flex-direction:row;
    align-items:center;
}

.save-btn{
    height:45px;
    border:none;
    border-radius:10px;
    background:#111827;
    color:white;
    font-weight:600;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
    padding: 7px 12px;
    border-bottom: 0.5px solid #f0f0ee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    vertical-align: middle;
    font-size: 12px;
}