/* ==========================================================================
   Admin Panel Styles
   ========================================================================== */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-100);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== Login Page ==================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-500);
}

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

/* ==================== Header ==================== */

.admin-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    text-decoration: none;
}

.admin-nav {
    display: flex;
    gap: 20px;
}

.admin-nav a {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: var(--primary);
}

.admin-nav .logout {
    color: var(--danger);
}

/* ==================== Main Content ==================== */

.admin-main {
    padding: 30px 0;
    min-height: calc(100vh - 120px);
}

.page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 24px;
    margin: 0;
}

.back-link {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: var(--primary);
}

/* ==================== Cards ==================== */

.card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.card h4 {
    font-size: 14px;
    margin: 20px 0 10px;
    color: var(--gray-600);
}

.card-danger {
    border: 1px solid var(--danger);
    background: #fef2f2;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* ==================== Forms ==================== */

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--gray-500);
    font-size: 12px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.inline-form {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.status-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ==================== Buttons ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-block {
    display: block;
    width: 100%;
}

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

.btn-icon {
    padding: 6px;
    min-width: 32px;
}

/* ==================== Alerts ==================== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==================== Tables ==================== */

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-compact th,
.table-compact td {
    padding: 8px 12px;
}

.actions-col {
    width: 120px;
}

.actions {
    display: flex;
    gap: 8px;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.project-link:hover {
    text-decoration: underline;
}

/* ==================== Status Badges ==================== */

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

.status-new {
    background: #dbeafe;
    color: #1e40af;
}

.status-progress {
    background: #fef3c7;
    color: #92400e;
}

.status-done {
    background: #d1fae5;
    color: #065f46;
}

.status-archived {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* ==================== Empty State ==================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

.empty-text {
    color: var(--gray-500);
    font-style: italic;
}

/* ==================== Link Box ==================== */

.link-box {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.link-box input {
    flex: 1;
    background: var(--gray-50);
}

.hint {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 10px;
}

.hint a {
    color: var(--primary);
}

/* ==================== Meta Info ==================== */

.meta-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.meta-info p {
    font-size: 13px;
    color: var(--gray-500);
    margin: 4px 0;
}

/* ==================== Collections ==================== */

.collections-admin-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.collection-admin-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.collection-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.collection-thumbnails .thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--gray-200);
    border: 1px solid var(--gray-300);
}

.collection-thumbnails .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-more {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-200);
    border-radius: 4px;
    color: var(--gray-500);
    font-size: 18px;
}


/* ==================== Exports ==================== */

.exports-list {
    list-style: none;
    margin-top: 16px;
}

.exports-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

/* ==================== Footer ==================== */

.admin-footer {
    padding: 20px 0;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    border-top: 1px solid var(--gray-200);
    background: white;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .link-box {
        flex-direction: column;
    }

    .table th,
    .table td {
        padding: 8px 12px;
        font-size: 13px;
    }

    .admin-nav {
        gap: 12px;
    }
}

/* ==================== Masters List ==================== */

.masters-admin-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.master-admin-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--gray-50);
}

.master-admin-header {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.master-admin-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--gray-300);
    flex-shrink: 0;
}

.master-admin-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.master-admin-photo .photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.master-admin-info h4 {
    margin: 0 0 4px !important;
    font-size: 16px;
    color: var(--gray-900);
}

.master-admin-info .description {
    font-size: 13px;
    color: var(--gray-600);
}

.master-admin-services h5 {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.admin-list-sm {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-list-sm li {
    font-size: 13px;
    padding: 4px 8px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    margin-bottom: 4px;
    display: inline-block;
    margin-right: 4px;
}
.admin-mini-photo {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--gray-300);
}

.admin-mini-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Admin Service Photos */
.admin-service-photo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid var(--gray-200);
}
