/* ============================================================
   CS Oilfield CRM - Unified Design System  v2.0
   Prefix: cso-  (tüm stiller bu prefix ile)
   ============================================================ */

/* ---------- RESET & BASE ---------- */
.cso-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: #1d2327;
    line-height: 1.6;
}

/* ---------- PAGE HEADER ---------- */
.cso-page-header {
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    border: 1px solid #e1e5ea;
}
.cso-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.cso-header-content h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #1d2327;
}
.cso-header-content h1 .dashicons {
    color: #2563eb;
    font-size: 26px;
    width: 26px;
    height: 26px;
}
.cso-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- BADGE ---------- */
.cso-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.cso-badge-primary   { background: #dbeafe; color: #1d4ed8; }
.cso-badge-success   { background: #dcfce7; color: #15803d; }
.cso-badge-warning   { background: #fef9c3; color: #854d0e; }
.cso-badge-danger    { background: #fee2e2; color: #b91c1c; }
.cso-badge-info      { background: #e0f2fe; color: #0369a1; }
.cso-badge-gray      { background: #f3f4f6; color: #6b7280; }

/* ---------- STAT CARDS ---------- */
.cso-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 20px;
}
.cso-stat-card {
    background: #f8faff;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e5eaf3;
    transition: transform .2s ease, box-shadow .2s ease;
}
.cso-stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.cso-stat-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
}
.cso-stat-icon .dashicons { font-size: 22px; width: 22px; height: 22px; }
.cso-icon-blue   { background: linear-gradient(135deg,#2563eb,#60a5fa); }
.cso-icon-green  { background: linear-gradient(135deg,#16a34a,#4ade80); }
.cso-icon-amber  { background: linear-gradient(135deg,#d97706,#fbbf24); }
.cso-icon-purple { background: linear-gradient(135deg,#7c3aed,#a78bfa); }
.cso-icon-rose   { background: linear-gradient(135deg,#e11d48,#fb7185); }
.cso-icon-teal   { background: linear-gradient(135deg,#0d9488,#2dd4bf); }
.cso-stat-content { flex: 1; min-width: 0; }
.cso-stat-number { display: block; font-size: 26px; font-weight: 800; color: #111; line-height: 1; }
.cso-stat-label  { font-size: 12px; color: #6b7280; font-weight: 500; margin-top: 4px; display: block; }

/* ---------- BUTTONS ---------- */
.cso-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s ease;
    min-height: 38px;
    box-sizing: border-box;
    white-space: nowrap;
}
.cso-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }

.cso-btn-primary   { background: #2563eb; border-color: #2563eb; color: #fff; }
.cso-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

.cso-btn-secondary { background: #f9fafb; border-color: #d1d5db; color: #374151; }
.cso-btn-secondary:hover { background: #f3f4f6; border-color: #9ca3af; color: #111; }

.cso-btn-success   { background: #16a34a; border-color: #16a34a; color: #fff; }
.cso-btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }

.cso-btn-danger    { background: #dc2626; border-color: #dc2626; color: #fff; }
.cso-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.cso-btn-excel     { background: #166534; border-color: #166534; color: #fff; }
.cso-btn-excel:hover { background: #14532d; border-color: #14532d; color: #fff; }

.cso-btn-pdf       { background: #9f1239; border-color: #9f1239; color: #fff; }
.cso-btn-pdf:hover { background: #881337; border-color: #881337; color: #fff; }

.cso-btn-sm { padding: 6px 12px; font-size: 12px; min-height: 30px; }
.cso-btn-icon { padding: 6px 8px; min-height: 30px; }

/* ---------- SEARCH BOX ---------- */
.cso-search-box {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e5ea;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 20px;
    overflow: hidden;
}
.cso-search-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    cursor: pointer;
    user-select: none;
}
.cso-search-toggle h3 { margin: 0; font-size: 14px; font-weight: 600; color: #374151; }
.cso-search-body { padding: 0 22px 22px; display: none; }
.cso-search-body.open { display: block; }
.cso-search-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cso-search-group label { display: block; font-size: 12px; font-weight: 600; color: #6b7280; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.cso-search-actions { display: flex; gap: 10px; padding-top: 16px; border-top: 1px solid #f3f4f6; }

/* ---------- FORM ELEMENTS ---------- */
.cso-input, .cso-select, .cso-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    color: #111;
}
.cso-input:focus, .cso-select:focus, .cso-textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    outline: none;
}
.cso-textarea { min-height: 90px; resize: vertical; }

/* ---------- TABLE CONTAINER ---------- */
.cso-table-wrap {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    border: 1px solid #e1e5ea;
}
.cso-table-header {
    padding: 18px 22px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #fcfcfd;
}
.cso-table-header h3 { margin: 0; font-size: 15px; color: #1d2327; }
.cso-table-header h3 small { font-size: 12px; color: #9ca3af; font-weight: 400; }
.cso-table-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cso-result-count { font-size: 12px; color: #9ca3af; }
.cso-export-btns { display: flex; gap: 8px; }

.cso-data-table { margin: 0; border: none !important; width: 100%; }
.cso-data-table th {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7280;
    background: #f9fafb;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
}
.cso-data-table td { padding: 12px; vertical-align: middle; font-size: 13px; color: #374151; }
.cso-data-table tbody tr:hover { background: #f8faff; }

.cso-action-btns { display: flex; gap: 6px; }

/* ---------- PERMISSION BADGE ---------- */
.cso-perm-yes { display: inline-flex; align-items: center; gap: 4px; color: #16a34a; font-weight: 600; font-size: 13px; }
.cso-perm-no  { display: inline-flex; align-items: center; gap: 4px; color: #dc2626; font-weight: 600; font-size: 13px; }

/* ---------- EMPTY STATE ---------- */
.cso-empty-state {
    padding: 60px 20px;
    text-align: center;
}
.cso-empty-state .dashicons { font-size: 52px; width: 52px; height: 52px; color: #d1d5db; margin-bottom: 16px; }
.cso-empty-state h4 { margin: 0 0 8px; color: #6b7280; font-size: 16px; }
.cso-empty-state p { margin: 0; color: #9ca3af; font-size: 14px; }
.cso-empty-state a { color: #2563eb; }

/* ---------- PAGINATION ---------- */
.cso-pagination {
    padding: 18px 22px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #fcfcfd;
}
.cso-pagination-info { font-size: 12px; color: #9ca3af; }
.cso-pagination-links { display: flex; gap: 4px; }
.cso-pagination-links .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 7px;
    border: 1px solid #e5e7eb; text-decoration: none;
    color: #374151; font-size: 13px; font-weight: 500;
    transition: all .2s;
}
.cso-pagination-links .page-numbers.current { background: #2563eb; color: #fff; border-color: #2563eb; }
.cso-pagination-links .page-numbers:hover:not(.current) { background: #f3f4f6; }

/* ---------- FORM PAGE ---------- */
.cso-form-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e5ea;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    overflow: hidden;
}
.cso-form-grid { display: grid; grid-template-columns: 1fr 1fr; }
.cso-form-col { padding: 28px; }
.cso-form-col + .cso-form-col { border-left: 1px solid #f3f4f6; }
.cso-section-title {
    display: flex; align-items: center; gap: 10px;
    padding-bottom: 16px; margin-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
    font-size: 15px; font-weight: 700; color: #1d2327;
}
.cso-section-title .dashicons { color: #2563eb; }
.cso-form-group { margin-bottom: 18px; }
.cso-form-label {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #374151;
}
.cso-form-label .dashicons { font-size: 15px; width: 15px; height: 15px; color: #9ca3af; }
.cso-form-hint { font-size: 11px; color: #9ca3af; margin-top: 5px; }
.cso-checkbox-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cso-checkbox-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.cso-checkbox-row span { font-size: 13px; color: #374151; }
.cso-form-footer {
    display: flex; justify-content: flex-end; gap: 12px;
    padding: 20px 28px; border-top: 1px solid #f3f4f6; background: #f9fafb;
}

/* ---------- NOTICES ---------- */
.cso-notice {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-radius: 10px; margin-bottom: 20px;
    font-size: 14px; font-weight: 500;
}
.cso-notice-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.cso-notice-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.cso-notice-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ---------- FRONTEND CRM WRAPPER ---------- */
.cso-frontend-crm { min-height: 500px; }
.cso-crm-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.cso-crm-nav {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e5ea;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    overflow: hidden;
    position: sticky;
    top: 20px;
}
.cso-nav-header {
    background: linear-gradient(135deg,#1e3a8a,#2563eb);
    padding: 20px;
    color: #fff;
}
.cso-nav-header h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; opacity: .9; }
.cso-nav-logo { font-size: 24px; margin-bottom: 8px; }
.cso-nav-user { font-size: 12px; opacity: .75; margin-top: 4px; }
.cso-nav-list { list-style: none; margin: 0; padding: 8px 0; }
.cso-nav-list li { margin: 0; }
.cso-nav-list a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 18px; font-size: 13px; font-weight: 500;
    color: #374151; text-decoration: none;
    transition: all .15s; border-left: 3px solid transparent;
}
.cso-nav-list a:hover { background: #f3f7ff; color: #2563eb; }
.cso-nav-list a.active { background: #eff6ff; color: #2563eb; border-left-color: #2563eb; font-weight: 700; }
.cso-nav-list a .dashicons { font-size: 17px; width: 17px; height: 17px; }
.cso-nav-divider { height: 1px; background: #f3f4f6; margin: 6px 0; }

.cso-crm-content { min-width: 0; }
.cso-login-prompt {
    background: #fff; border-radius: 12px; border: 1px solid #e1e5ea;
    padding: 60px 20px; text-align: center;
}
.cso-login-prompt .dashicons { font-size: 56px; width: 56px; height: 56px; color: #2563eb; margin-bottom: 20px; }
.cso-login-prompt h3 { margin: 0 0 10px; font-size: 20px; }
.cso-login-prompt p { color: #6b7280; margin-bottom: 20px; }
.cso-access-denied { background: #fef2f2; border-radius: 12px; border: 1px solid #fecaca; padding: 30px; text-align: center; color: #b91c1c; }

/* ---------- ADMIN PERMISSION PAGE ---------- */
.cso-perm-table { background: #fff; border-radius: 12px; border: 1px solid #e1e5ea; overflow: hidden; }
.cso-perm-table table { width: 100%; border-collapse: collapse; }
.cso-perm-table th { background: #f9fafb; padding: 14px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6b7280; text-align: left; border-bottom: 1px solid #e5e7eb; }
.cso-perm-table td { padding: 14px 16px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
.cso-perm-table tr:last-child td { border-bottom: none; }
.cso-module-checks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.cso-module-check { display: inline-flex; align-items: center; gap: 6px; background: #f8f9fa; border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: all .2s; }
.cso-module-check:hover { border-color: #2563eb; background: #eff6ff; }
.cso-module-check input[type=checkbox]:checked + span { color: #2563eb; font-weight: 600; }
.cso-user-role-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.cso-role-crm_yonetici { background: #dbeafe; color: #1d4ed8; }
.cso-role-crm_operator { background: #dcfce7; color: #15803d; }
.cso-role-crm_goruntüleyici { background: #fef9c3; color: #854d0e; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .cso-form-grid { grid-template-columns: 1fr; }
    .cso-form-col + .cso-form-col { border-left: none; border-top: 1px solid #f3f4f6; }
    .cso-crm-layout { grid-template-columns: 1fr; }
    .cso-crm-nav { position: static; }
}
@media (max-width: 768px) {
    .cso-header-content { flex-direction: column; align-items: flex-start; }
    .cso-stats-grid { grid-template-columns: 1fr 1fr; }
    .cso-table-header { flex-direction: column; align-items: flex-start; }
    .cso-export-btns { flex-direction: column; width: 100%; }
    .cso-export-btns .cso-btn { width: 100%; justify-content: center; }
    .cso-pagination { flex-direction: column; }
    .cso-form-col { padding: 20px; }
    .cso-form-footer { flex-direction: column; }
}
@media (max-width: 480px) {
    .cso-stats-grid { grid-template-columns: 1fr; }
    .cso-search-grid { grid-template-columns: 1fr; }
}
