/* ===== Variables ===== */
:root {
    --primary: #d4a039;
    --primary-dark: #b8892f;
    --secondary: #2c3e50;
    --dark: #1a1a2e;
    --darker: #16162a;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --transition: 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-light);
    color: var(--dark);
    line-height: 1.6;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 100%);
    padding: 20px;
}

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

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-logo {
    margin-bottom: 15px;
}

.login-logo .logo-icon {
    display: inline-flex;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: var(--dark);
    font-size: 28px;
    font-weight: bold;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
}

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

.login-header p {
    opacity: 0.8;
    font-size: 14px;
}

.login-form {
    padding: 30px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Password Toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary);
}

.eye-icon {
    width: 22px;
    height: 22px;
}

.error-message {
    background: #fff5f5;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #ffebeb;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(212, 160, 57, 0.3);
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

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

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

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: var(--dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-footer {
    padding: 20px 30px;
    text-align: center;
    background: var(--gray-light);
    color: var(--gray);
    font-size: 13px;
}

/* ===== Admin Layout ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark) 0%, var(--darker) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo .logo-icon {
    display: flex;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--dark);
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-weight: 600;
    font-size: 18px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

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

.nav-item {
    margin-bottom: 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-item a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active a {
    color: var(--primary);
    background: rgba(212, 160, 57, 0.1);
}

.nav-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

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

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    justify-content: flex-start;
}

.btn-logout:hover {
    background: rgba(220, 53, 69, 0.3);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.sidebar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    transition: var(--transition);
}

.top-bar-title h1 {
    font-size: 20px;
    font-weight: 600;
}

.top-bar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray);
}

.content-wrapper {
    flex: 1;
    padding: 24px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ===== Dashboard ===== */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.dashboard-welcome h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.dashboard-welcome p {
    opacity: 0.8;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(212, 160, 57, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
}

.dashboard-sites h3 {
    margin-bottom: 16px;
    color: var(--secondary);
}

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

.site-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: var(--transition);
}

.site-card.active {
    border-color: var(--success);
}

.site-card.disabled {
    opacity: 0.6;
}

.site-icon {
    width: 50px;
    height: 50px;
    background: var(--gray-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.site-card.active .site-icon {
    background: rgba(40, 167, 69, 0.1);
}

.site-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.site-info p {
    font-size: 13px;
    color: var(--gray);
}

.site-status {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--gray-light);
    color: var(--gray);
}

.site-card.active .site-status {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

/* Site Actions */
.site-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.site-actions .site-status {
    margin-left: 0;
}

.btn-visit-site {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
}

.btn-visit-site:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===== Section Placeholder ===== */
.section-placeholder {
    background: white;
    padding: 60px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-placeholder h2 {
    margin-bottom: 10px;
    color: var(--secondary);
}

.section-placeholder p {
    color: var(--gray);
}

/* ===== Section Header ===== */
.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 8px;
}

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

/* ===== Card ===== */
.card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ===== Forms ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: #adb5bd;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-light);
    margin-top: 10px;
}

.save-status {
    font-size: 14px;
    font-weight: 500;
}

.save-status.success {
    color: var(--success);
}

.save-status.error {
    color: var(--danger);
}

/* ===== Card Header ===== */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-light);
}

.card-header h3 {
    font-size: 18px;
    color: var(--dark);
}

/* ===== Categories List ===== */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--gray-light);
    border-radius: 8px;
    transition: var(--transition);
}

.category-item:hover {
    background: #e2e6ea;
}

.category-item.hidden,
.category-item.hidden-cat {
    opacity: 0.5;
}

.category-name {
    font-weight: 500;
    color: var(--dark);
}

.category-key {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-top: 2px;
}

.drag-handle {
    cursor: grab;
    color: var(--gray);
    font-size: 18px;
}

.drag-handle:active {
    cursor: grabbing;
}

.category-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.category-info {
    flex: 1;
}

.category-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--dark);
}

.category-langs {
    display: flex;
    gap: 6px;
}

.lang-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--gray);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    opacity: 0.4;
}

.lang-tag.active {
    background: var(--success);
    opacity: 1;
}

.category-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Toggle Switch ===== */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ===== Buttons ===== */
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #dee2e6;
}

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

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

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

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

.btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(212, 160, 57, 0.3);
    user-select: none;
}

.btn-icon:hover {
    background: var(--gray-light);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-icon.danger:hover,
.btn-icon.btn-danger:hover {
    background: #fff5f5;
    border-color: var(--danger);
    color: var(--danger);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-light);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--dark);
}

.modal-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    /* Touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    user-select: none;
}

.modal-close:hover {
    background: var(--gray-light);
    color: var(--dark);
}

.modal-close:active {
    transform: scale(0.9);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-light);
    background: var(--gray-light);
}

/* ===== Language Tabs ===== */
.lang-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--gray-light);
    padding: 4px;
    border-radius: 8px;
}

.lang-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
}

.lang-tab:hover {
    color: var(--dark);
}

.lang-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lang-content {
    display: none;
}

.lang-content.active {
    display: block;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state p {
    font-size: 15px;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    background: var(--dark);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

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

/* ===== Products ===== */
.products-filter {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 8px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 14px;
    min-width: 180px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--gray-light);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card.hidden-card {
    opacity: 0.5;
}

.product-image {
    aspect-ratio: 4/3;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image .no-image {
    font-size: 48px;
    color: var(--gray);
    opacity: 0.3;
}

.product-info {
    padding: 16px;
}

.product-info h4 {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--dark);
    line-height: 1.3;
}

.product-subtitle {
    display: block;
    font-size: 13px;
    color: var(--secondary);
    margin-bottom: 4px;
    font-style: italic;
}

.product-category {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 6px;
}

.product-description {
    font-size: 12px;
    color: var(--gray);
    line-height: 1.4;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.product-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.5);
}

/* ===== Image Upload ===== */
.image-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-upload input[type="file"] {
    padding: 10px;
    background: var(--gray-light);
    border: 2px dashed var(--gray);
    border-radius: 8px;
    cursor: pointer;
}

.image-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Modal Large ===== */
.modal-content.modal-lg {
    max-width: 800px;
}

/* ===== Orders ===== */
.orders-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card.stat-new .stat-icon {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.stat-card.stat-progress .stat-icon {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.stat-card.stat-done .stat-icon {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.orders-total {
    font-size: 14px;
    color: var(--gray);
}

.orders-table-container {
    overflow-x: auto;
}

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

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

.orders-table th {
    font-weight: 600;
    color: var(--gray);
    font-size: 13px;
    text-transform: uppercase;
}

.orders-table td {
    font-size: 14px;
}

.orders-table tr.row-new {
    background: rgba(220, 53, 69, 0.05);
}

.orders-table a {
    color: var(--primary);
    text-decoration: none;
}

.orders-table a:hover {
    text-decoration: underline;
}

.empty-cell {
    text-align: center;
    color: var(--gray);
    padding: 40px 16px !important;
}

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

.status-badge.status-new {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.status-badge.status-progress {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.status-badge.status-done {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

/* ===== Order Details ===== */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-detail-row {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-light);
}

.order-detail-row:last-child {
    border-bottom: none;
}

.order-detail-row .label {
    font-weight: 600;
    color: var(--gray);
    min-width: 140px;
}

/* ===== Settings ===== */
.form-hint {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-top: 6px;
}

.settings-help {
    padding: 0;
}

.settings-help ol {
    margin: 0;
    padding-left: 20px;
}

.settings-help li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
}

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

.settings-help code {
    background: var(--gray-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .admin-layout.sidebar-open .sidebar {
        transform: translateX(0);
    }

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

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        padding: 16px;
    }

    .dashboard-welcome {
        padding: 24px;
    }

    .dashboard-welcome h2 {
        font-size: 22px;
    }
}

/* ===== Site Selector ===== */
.site-selector {
    padding: 8px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-right: 16px;
    background: white;
    cursor: pointer;
    min-width: 200px;
    transition: var(--transition);
}

.site-selector:focus {
    border-color: var(--primary);
    outline: none;
}

.site-selector:hover {
    border-color: var(--gray);
}

.top-bar-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Site cards clickable */
.site-card.clickable {
    cursor: pointer;
}

.site-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.site-card.selected {
    border-color: var(--primary);
    background: rgba(212, 160, 57, 0.05);
}

.site-card.selected .site-status {
    background: rgba(212, 160, 57, 0.1);
    color: var(--primary);
}


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

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

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

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

.users-table td {
    vertical-align: middle;
}

.users-table tr:hover {
    background: var(--light);
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.role-admin {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.role-badge.role-accountant {
    background: rgba(108, 117, 125, 0.1);
    color: var(--gray);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 8px;
    margin: 0 20px;
}

.lang-btn {
    padding: 10px 14px;
    min-height: 44px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    /* Touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(33, 150, 243, 0.3);
    user-select: none;
}

.lang-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.lang-btn:active {
    transform: scale(0.95);
    background: #e0e0e0;
}

.lang-btn.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* ===== Category Form Improvements ===== */

/* Form hints */
.form-hint {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.form-hint-error {
    color: var(--danger);
    font-weight: 500;
}

/* Readonly input style */
.input-readonly {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    border-style: dashed;
}

/* Language flags */
.lang-flag {
    margin-right: 6px;
    font-size: 16px;
}

.key-icon,
.icon-label {
    margin-right: 6px;
}

/* Form divider */
.form-divider {
    text-align: center;
    margin: 20px 0 16px;
    position: relative;
}

.form-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.form-divider span {
    background: white;
    padding: 0 12px;
    position: relative;
    color: #888;
    font-size: 13px;
}

/* Category preview */
.category-preview {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
}

.preview-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.preview-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--dark);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.preview-names {
    flex: 1;
}

.preview-names strong {
    display: block;
    font-size: 15px;
    color: var(--dark);
}

.preview-names small {
    color: #888;
    font-size: 12px;
    font-family: monospace;
}

/* Search field */
.filter-search {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    margin-left: 10px;
    min-width: 250px;
    transition: border-color 0.3s;
}

.filter-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.orders-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.page-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
