/* ==========================================================================
   WinDev Bilişim - Sade ve Kurumsal Yönetim Paneli Stilleri
   Tasarım Prensibi: Sade, resmi, süslendirmesiz, veri ve iş odaklı kurumsal arayüz.
   ========================================================================== */

:root {
    --primary: #7a3a3e;
    --primary-hover: #632d30;
    --navy-dark: #0f172a;
    --navy-light: #1e293b;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Üst Kurumsal Bar */
.top-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.top-brand img {
    height: 34px;
    width: auto;
    object-fit: contain;
}
.top-brand span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-left: 1px solid var(--border);
    padding-left: 12px;
}

.top-user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}
.user-badge {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* Ana Düzen (Sidebar + İçerik) */
.layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 10px 24px 6px;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: #334155;
    font-weight: 500;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-nav li a:hover {
    background-color: #f8fafc;
    color: var(--primary);
    text-decoration: none;
}

.sidebar-nav li a.active {
    background-color: #fdf2f2;
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1300px;
}

/* Başlık Alanı */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.page-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy-dark);
}
.page-title p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Kurumsal Kart */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 24px;
}

.card-header {
    padding: 14px 20px;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2, .card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-dark);
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* İstatistik / Metrik Kutuları */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 18px 20px;
    border-top: 3px solid var(--navy-light);
}
.stat-box.primary {
    border-top-color: var(--primary);
}
.stat-box.success {
    border-top-color: var(--success);
}
.stat-box.warning {
    border-top-color: var(--warning);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}
.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--navy-dark);
    margin-top: 6px;
}

/* Kurumsal Veri Tablosu */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

table.data-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
    white-space: nowrap;
}

table.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

/* Lisans Kodu Alanı */
.license-code {
    font-family: Consolas, "Courier New", monospace;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e8f0;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 2px;
}
.copy-btn:hover {
    background: #e2e8f0;
}

/* Rozetler (Badges) */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    white-space: nowrap;
}

.badge-active {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-expired {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

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

.badge-suspended {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-lifetime {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.badge-urgent {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-weight: 700;
}

/* Butonlar */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff !important;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

.btn-secondary {
    background-color: #ffffff;
    color: #334155;
    border-color: var(--border-dark);
}
.btn-secondary:hover {
    background-color: #f8fafc;
    text-decoration: none;
}

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

.btn-danger {
    background-color: #dc2626;
    color: #ffffff !important;
}
.btn-danger:hover {
    background-color: #b91c1c;
    text-decoration: none;
}

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

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

.form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    background-color: #ffffff;
    color: var(--text-main);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(122, 58, 62, 0.15);
}

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

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

/* Destek Mesajlaşma Akışı */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.ticket-message {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #ffffff;
}

.ticket-message.admin-reply {
    border-left: 4px solid var(--primary);
    background: #fffafa;
}

.ticket-message-header {
    background: #f8fafc;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}
.ticket-message.admin-reply .ticket-message-header {
    background: #fdf2f2;
}

.ticket-message-body {
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Bildirim Kutuları */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 20px;
}
.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Giriş Sayfası Kartı */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #f1f5f9;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.login-header {
    padding: 30px 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.login-header img {
    height: 48px;
    margin-bottom: 12px;
}
.login-header h1 {
    font-size: 18px;
    color: var(--navy-dark);
}
.login-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.login-body {
    padding: 28px 24px;
}
.login-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .main-content {
        padding: 20px 16px;
    }
}
