/* assets/css/style.css - Orbeta Destek Paneli */
/* Renk Paleti: Koyu Bordo/Kırmızı - Orbeta marka renkleri */

:root {
    --primary:       #8b0000;
    --primary-dark:  #6b0f1a;
    --primary-light: #a83232;
    --accent:        #c0392b;
    --bg:            #f4f6f9;
    --bg-card:       #ffffff;
    --sidebar-bg:    #1a0508;
    --sidebar-w:     250px;
    --topbar-h:      60px;
    --text:          #2d3436;
    --text-muted:    #636e72;
    --border:        #e0e0e0;
    --success:       #27ae60;
    --warning:       #f39c12;
    --danger:        #e74c3c;
    --info:          #2980b9;
    --radius:        10px;
    --shadow:        0 2px 12px rgba(0,0,0,.08);
    --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
    --transition:    .2s ease;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition);
    overflow-y: auto;
}

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

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
}

.brand-text {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .3px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    margin: 2px 0;
}

.nav-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
    border-left-color: var(--primary-light);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(139,0,0,.4), rgba(139,0,0,.1));
    color: #fff;
    border-left-color: var(--accent);
}

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

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name { color: #fff; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,.5); font-size: 11px; }

.btn-cikis {
    color: rgba(255,255,255,.5);
    font-size: 18px;
    text-decoration: none;
    transition: color var(--transition);
    padding: 4px;
}
.btn-cikis:hover { color: var(--danger); }

/* ===================== MAIN WRAPPER ===================== */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

/* ===================== TOPBAR ===================== */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    display: none;
}
.sidebar-toggle:hover { background: var(--bg); }

.topbar-title {
    flex: 1;
    font-weight: 800;
    font-size: 16px;
    color: var(--primary-dark);
}

.btn-yeni-is {
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition);
}
.btn-yeni-is:hover { background: var(--primary-dark); }

/* ===================== CONTENT ===================== */
.content-area {
    flex: 1;
    padding: 28px 24px;
    max-width: 1400px;
    width: 100%;
}

/* ===================== CARDS ===================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    overflow: hidden;
}

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

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

.card-body { padding: 20px; }

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

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.red    { background: #fdf0f0; color: var(--primary); }
.stat-icon.green  { background: #eafaf1; color: var(--success); }
.stat-icon.blue   { background: #eaf4fd; color: var(--info); }
.stat-icon.orange { background: #fef9e7; color: var(--warning); }

.stat-info .stat-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.stat-info .stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
}

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

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

thead tr { background: #fdf0f0; }
thead th {
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--primary-dark);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
tbody tr:hover { background: #fdf6f6; }
tbody tr:last-child { border-bottom: none; }

td { padding: 12px 14px; font-size: 13px; vertical-align: middle; }

.ticket-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.ticket-link:hover { text-decoration: underline; }

/* ===================== BADGES ===================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
}
.badge-success   { background: #d5f5e3; color: #1e8449; }
.badge-primary   { background: #d6eaf8; color: #1a5276; }
.badge-warning   { background: #fef9e7; color: #7d6608; }
.badge-danger    { background: #fde8e8; color: #922b21; }
.badge-info      { background: #d6eaf8; color: #1a5276; }
.badge-secondary { background: #f0f0f0; color: #555; }
.badge-dark      { background: #e8e8e8; color: #333; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--primary-dark);
}
label .req { color: var(--danger); margin-left: 3px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139,0,0,.1);
}

textarea { min-height: 120px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

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

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

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

/* ===================== ALERTS ===================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.alert-danger   { background: #fde8e8; color: #922b21; border: 1px solid #f1948a; }
.alert-info     { background: #d6eaf8; color: #1a5276; border: 1px solid #85c1e9; }
.alert-warning  { background: #fef9e7; color: #7d6608; border: 1px solid #f9e79f; }

/* ===================== PAGINATION ===================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.page-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition);
}
.page-btn:hover, .page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===================== LOGIN PAGE ===================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary-dark) 50%, #2d0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo img {
    max-width: 140px;
    max-height: 70px;
    object-fit: contain;
}
.login-logo h2 {
    color: var(--primary-dark);
    font-size: 20px;
    margin-top: 12px;
    font-weight: 800;
}
.login-logo p { color: var(--text-muted); font-size: 13px; }

/* ===================== TICKET DETAIL ===================== */
.ticket-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 24px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.ticket-header .ticket-no { font-size: 13px; opacity: .8; margin-bottom: 6px; }
.ticket-header h2 { font-size: 20px; font-weight: 800; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 12px; opacity: .85; }

.comments-list { padding: 0; }
.comment-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 14px;
}
.comment-item:last-child { border-bottom: none; }

.comment-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.comment-avatar.customer { background: var(--info); }
.comment-avatar.mail     { background: var(--success); }
.comment-avatar.internal { background: var(--warning); }

.comment-body { flex: 1; }
.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.comment-author { font-weight: 700; font-size: 13px; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: 13.5px; color: var(--text); line-height: 1.7; white-space: pre-wrap; }
.comment-internal { background: #fef9e7; border-left: 3px solid var(--warning); border-radius: 4px; padding: 10px 14px; }

/* ===================== FILTERS ===================== */
.filter-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"] {
    width: auto;
    min-width: 150px;
}

/* ===================== MODAL ===================== */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 800; color: var(--primary-dark); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); padding: 0 4px; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===================== EMPTY STATE ===================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 15px; font-weight: 600; }

/* ===================== SIDEBAR OVERLAY ===================== */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
}

/* ===================== DASHBOARD GRID ===================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle { display: flex; }
    .main-wrapper { margin-left: 0; }
    .content-area { padding: 12px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .login-card { padding: 30px 24px; }
    
    /* Ticket header meta responsive */
    .ticket-meta { flex-direction: column; gap: 6px; }
    
    /* İki kolonlu grid'leri tek kolona al */
    .form-row { grid-template-columns: 1fr; }
    
    /* Admin/personel iki kolonlu layoutlar */
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns:1fr 300px"],
    div[style*="grid-template-columns: 1fr 300px"],
    div[style*="grid-template-columns:1fr 280px"],
    div[style*="grid-template-columns: 1fr 280px"],
    div[style*="grid-template-columns:1fr 260px"],
    div[style*="grid-template-columns: 1fr 260px"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Stat kartlar mobil */
    .stat-card { padding: 14px; }
    .stat-icon { width: 42px; height: 42px; font-size: 18px; }
    .stat-info .stat-val { font-size: 22px; }
    
    /* Tablo mobil scroll */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 500px; }
    
    /* Topbar */
    .topbar { padding: 0 12px; }
    .topbar-title { font-size: 14px; }
    .btn-yeni-is span { display: none; }
    
    /* Filter bar */
    .filter-bar { padding: 12px; }
    .filter-bar form { gap: 8px; }
    .filter-bar select,
    .filter-bar input[type="text"],
    .filter-bar input[type="date"] {
        width: 100%;
        min-width: auto;
    }
    
    /* Card header */
    .card-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .card-body { padding: 14px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-info .stat-val { font-size: 20px; }
    .stat-info .stat-lbl { font-size: 11px; }
    
    .filter-bar form { flex-direction: column; }
    
    /* Login */
    .login-card { padding: 24px 16px; }
    .login-logo h2 { font-size: 17px; }
    
    /* Butonlar */
    .btn { padding: 8px 14px; font-size: 12px; }
    .btn-sm { padding: 5px 10px; font-size: 11px; }
    
    /* Yorum alanı */
    .comment-item { gap: 8px; }
    .comment-avatar { width: 30px; height: 30px; font-size: 12px; }
}

/* ===================== UTILITIES ===================== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; } .align-center { align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.fw-bold { font-weight: 700; }
.no-wrap { white-space: nowrap; }
