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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
}

.admin-container {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.sidebar-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.sidebar-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #667eea;
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left-color: #667eea;
}

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

.nav-text {
    font-size: 15px;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
}

/* Header */
.admin-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Secondary button in modal (dark background) */
.modal .btn-secondary {
    background: #4a4a4a;
    color: white;
    border: 1px solid #5a5a5a;
}

.modal .btn-secondary:hover {
    background: #5a5a5a;
    border-color: #6a6a6a;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-edit {
    background: #3498db;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-delete:hover {
    background: #c0392b;
}

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

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* Main Content */
.admin-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 30px auto;
    padding: 0 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h2 {
    font-size: 28px;
    color: #e0e0e0;
    font-weight: 700;
}

.pdis-section {
    background: #2d2d2d;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 25px;
}

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #404040;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #2d2d2d;
    color: #e0e0e0;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select option {
    background: #2d2d2d;
    color: #e0e0e0;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

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

.pdis-table thead {
    background: #1a1a1a;
}

.pdis-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #e0e0e0;
    border-bottom: 2px solid #404040;
    font-size: 14px;
}

.pdis-table td {
    padding: 15px;
    border-bottom: 1px solid #353535;
    font-size: 14px;
    color: #d0d0d0;
}

.pdis-table tbody tr:hover {
    background: #353535;
}

.pdi-status-pending {
    background: #856404;
    color: #fff3cd;
}

.pdi-status-approved {
    background: #155724;
    color: #d4edda;
}

.pdi-status-rejected {
    background: #721c24;
    color: #f8d7da;
}

.settings-section {
    background: #2d2d2d;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 25px;
}

.settings-card {
    padding: 20px;
    border-bottom: 1px solid #404040;
}

.settings-card:last-child {
    border-bottom: none;
}

.settings-card h3 {
    font-size: 18px;
    color: #e0e0e0;
    margin-bottom: 10px;
}

.modal-large {
    max-width: 900px;
}

.pdi-detail-section {
    margin-bottom: 24px;
}

.pdi-detail-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #404040;
}

.pdi-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pdi-detail-item {
    display: flex;
    flex-direction: column;
}

.pdi-detail-label {
    font-size: 12px;
    color: #b0b0b0;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdi-detail-value {
    font-size: 16px;
    color: #e0e0e0;
    font-weight: 500;
}

.pdi-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.pdi-photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #404040;
}

.pdi-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdi-photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px;
    font-size: 12px;
    text-align: center;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #2d2d2d;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.stat-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 32px;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.stat-info p {
    color: #b0b0b0;
    font-size: 14px;
}

/* Users Section */
.users-section {
    background: #2d2d2d;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 24px;
    color: #e0e0e0;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 10px 40px 10px 15px;
    border: 2px solid #404040;
    border-radius: 8px;
    font-size: 14px;
    width: 300px;
    background: #1a1a1a;
    color: #e0e0e0;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box input::placeholder {
    color: #808080;
}

.search-icon {
    position: absolute;
    right: 12px;
    color: #808080;
}

/* Table */
.table-container {
    overflow-x: auto;
}

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

.users-table thead {
    background: #1a1a1a;
}

.users-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #e0e0e0;
    border-bottom: 2px solid #404040;
    font-size: 14px;
}

.users-table td {
    padding: 15px;
    border-bottom: 1px solid #353535;
    font-size: 14px;
    color: #d0d0d0;
}

.users-table tbody tr:hover {
    background: #353535;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: #155724;
    color: #d4edda;
}

.status-inactive {
    background: #721c24;
    color: #f8d7da;
}

.role-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.role-personel {
    background: #1976d2;
    color: #e3f2fd;
}

.role-kalite_kontrol {
    background: #f57c00;
    color: #fff3e0;
}

.role-admin {
    background: #7b1fa2;
    color: #f3e5f5;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #808080;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #808080;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #2d2d2d;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-large {
    max-width: 95%;
    width: 1200px;
    max-height: 95vh;
}

.modal-small {
    max-width: 400px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 2px solid #404040;
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: bold;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    background: #1a1a1a;
    color: #e0e0e0;
}

.modal-body * {
    color: inherit;
}

.modal-body h1,
.modal-body h2,
.modal-body h3,
.modal-body h4,
.modal-body h5,
.modal-body h6 {
    color: #e0e0e0;
}

.modal-body p {
    color: #d0d0d0;
}

.modal-large .modal-body {
    padding: 30px;
    max-height: calc(95vh - 200px);
    overflow-y: auto;
}

.warning-text {
    color: #e74c3c;
    font-weight: 600;
    margin-top: 10px;
}

/* Form */
#userForm {
    padding: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #404040;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #1a1a1a;
    color: #e0e0e0;
    transition: border-color 0.3s ease;
}

.form-group select option {
    background: #2d2d2d;
    color: #e0e0e0;
    padding: 10px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #808080;
}

/* Template Section Styles */
.template-section {
    background: #2d2d2d !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0;
}

.template-section h4 {
    color: #e0e0e0 !important;
}

.section-title-input,
.question-input {
    background: #1a1a1a !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

.section-title-input:focus,
.question-input:focus {
    border-color: #667eea !important;
    outline: none;
}

.section-title-input::placeholder,
.question-input::placeholder {
    color: #808080 !important;
}

#templateModels {
    background: #1a1a1a !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0;
}

#templateModels label {
    color: #e0e0e0 !important;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #b0b0b0;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #404040;
    margin-top: 20px;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    backdrop-filter: blur(10px);
}

.notification::before {
    content: '';
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-left: 4px solid #047857;
}

.notification.success::before {
    content: '✓';
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-left: 4px solid #b91c1c;
}

.notification.error::before {
    content: '✕';
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .admin-header {
        padding: 15px 20px;
    }

    .admin-header h1 {
        font-size: 22px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-main {
        padding: 0 15px;
        margin: 20px auto;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box input {
        width: 100%;
    }

    .users-table,
    .pdis-table {
        font-size: 12px;
    }

    .users-table th,
    .users-table td,
    .pdis-table th,
    .pdis-table td {
        padding: 10px 8px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}
