/* ================================================
   AXOFLINK PROFESSIONAL DESIGN SYSTEM
   Commercialized Edition v2.0
   ================================================ */

:root {
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 22px;
    --font-size-2xl: 28px;

    /* Font Weights */
    --font-regular: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Colors - Neutral (Softer) */
    --color-bg: #f9fafb;
    --color-bg-secondary: #f3f4f6;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --color-text-primary: #374151;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;

    /* Colors - Brand (Softer, Pastel-like) */
    --color-primary: #60a5fa;
    --color-primary-hover: #3b82f6;
    --color-primary-light: rgba(96, 165, 250, 0.12);
    --color-success: #4ade80;
    --color-success-hover: #22c55e;
    --color-success-light: rgba(74, 222, 128, 0.12);
    --color-warning: #fbbf24;
    --color-warning-light: rgba(251, 191, 36, 0.12);
    --color-danger: #f87171;
    --color-danger-hover: #ef4444;
    --color-danger-light: rgba(248, 113, 113, 0.12);
    --color-info: #60a5fa;
    --color-maintenance: #fb923c;
    --color-purple: #a78bfa;

    /* Header Colors (preserved - these stay as is) */
    --color-header-main: #1f2937;
    --color-header-admin: #dc2626;
    --color-header-operator: #16a34a;
    --color-header-planning: #7c3aed;

    /* Shadows - Enhanced */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-glow-primary: 0 0 20px rgba(52, 152, 219, 0.3);
    --shadow-glow-success: 0 0 20px rgba(39, 174, 96, 0.3);
    --shadow-glow-danger: 0 0 20px rgba(231, 76, 60, 0.3);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Transitions - Enhanced */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ================================================
   PROFESSIONAL ANIMATIONS
   ================================================ */

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Animations */
@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Pulse & Glow */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes pulseScale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
    }
}

@keyframes glowSuccess {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(39, 174, 96, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(39, 174, 96, 0.6);
    }
}

@keyframes glowDanger {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
    }
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Shimmer Loading Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Animation Utility Classes */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.4s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.4s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.4s ease-out forwards;
}

.animate-fade-in-scale {
    animation: fadeInScale 0.3s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-glow-success {
    animation: glowSuccess 2s ease-in-out infinite;
}

.animate-glow-danger {
    animation: glowDanger 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Staggered Animation Delays */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ================================================
   BASE STYLES
   ================================================ */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-regular);
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- LOGIN (Enhanced) --- */
.login-bg {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 50%, #34495e 100%);
    padding: var(--space-4);
    position: relative;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.08) 0%, transparent 50%);
    animation: pulseScale 8s ease-in-out infinite;
}

.login-bg::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(39, 174, 96, 0.05) 0%, transparent 50%);
    animation: pulseScale 10s ease-in-out infinite reverse;
}

.login-container {
    background: var(--color-surface);
    padding: 40px 32px;
    border-radius: var(--radius-2xl);
    text-align: center;
    width: 400px !important;
    max-width: 95%;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
    backdrop-filter: blur(10px);
}

.login-container h2 {
    color: var(--color-text-primary);
    font-weight: var(--font-bold);
    font-size: 26px;
    margin: 0 0 var(--space-1) 0;
    letter-spacing: -0.5px;
}

.login-container input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    transition: all var(--transition-base);
    background: var(--color-bg);
}

.login-container input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.12);
    background: var(--color-surface);
    transform: translateY(-1px);
}

.login-container input:hover:not(:focus) {
    border-color: var(--color-text-muted);
}

.login-container input::placeholder {
    color: var(--color-text-muted);
}

.login-container button {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-md);
    font-weight: var(--font-semibold);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.login-container button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-container button:hover::before {
    left: 100%;
}

.login-container button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-container button:active {
    transform: translateY(0);
}

.error {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    margin: 0;
    padding: var(--space-3) var(--space-4);
    background: var(--color-danger-light);
    border-radius: var(--radius-lg);
    width: 100%;
    border: 1px solid rgba(231, 76, 60, 0.2);
    animation: shake 0.5s ease-out;
}

.switch-link {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: var(--font-semibold);
    font-size: var(--font-size-sm);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
    background: rgba(255, 255, 255, 0.08);
    transition: all var(--transition-base);
    backdrop-filter: blur(5px);
}

.switch-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* --- HEADER (Enhanced) --- */
header {
    background: linear-gradient(135deg, var(--color-header-main) 0%, #2c3e50 100%);
    color: white;
    padding: var(--space-4) var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 100;
    animation: slideDown 0.4s ease-out;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

header h1 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    margin: 0;
    letter-spacing: -0.01em;
}

.admin-header {
    background-color: var(--color-header-admin);
}

.license-badge {
    font-size: 13px;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    background-color: #34495e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

.license-safe {
    background-color: #27ae60;
}

.license-danger {
    background-color: #e74c3c;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* --- GENEL --- */
.container {
    padding: 20px;
    max-width: 1800px;
    margin: 0 auto;
}

.monitor-container {
    padding: 20px;
    width: 98%;
    margin: 0 auto;
}

/* --- BUTTONS (Enhanced) --- */
button {
    cursor: pointer;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-semibold);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.4s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow-primary);
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- INPUTS --- */
input,
select {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    background: var(--color-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.12);
}

input::placeholder {
    color: var(--color-text-muted);
}

/* --- BUTTON VARIANTS --- */
.delete-btn {
    background: var(--color-danger);
}

.delete-btn:hover {
    background: var(--color-danger-hover);
}

.config-btn {
    background: var(--color-maintenance);
}

.config-btn:hover {
    background: #d35400;
}

.save-btn {
    background: var(--color-success);
    width: 100%;
    margin-top: var(--space-3);
}

.save-btn:hover {
    background: var(--color-success-hover);
}

.header-actions {
    display: flex;
    gap: var(--space-3);
}

.monitor-btn {
    background: var(--color-success);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.monitor-btn:hover {
    background: var(--color-success-hover);
    border-color: rgba(255, 255, 255, 0.5);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* --- TABLO (Enhanced) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-4);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-light);
    animation: fadeInUp 0.4s ease-out;
}

th,
td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    transition: all var(--transition-fast);
}

th {
    background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
    color: var(--color-text-secondary);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr {
    transition: all var(--transition-fast);
}

tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.5);
}

tr:hover:not(:first-child) {
    background-color: var(--color-primary-light);
    transform: scale(1.002);
}

.action-cell {
    display: flex;
    gap: 5px;
}

.icon-btn {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #eee;
    color: #333;
}

/* --- KULLANICI ROLLERİ --- */
.role-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: white;
    font-weight: bold;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.role-op {
    background: #27ae60;
}

.role-plan {
    background: #9b59b6;
}

.role-maint {
    background: #e67e22;
}

/* --- ADMIN LİSTELERİ --- */
.user-item {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-bottom: 10px;
}

.list-item {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
}

.list-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    border-color: var(--color-primary);
}

.list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--color-primary), var(--color-success));
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.list-item:hover::before {
    opacity: 1;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.config-panel {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* --- OPERATÖR PANELİ (Enhanced) --- */
.op-card {
    background: var(--color-surface);
    padding: var(--space-6);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-6);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
    animation: fadeInUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.op-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.op-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.op-card:hover::before {
    opacity: 1;
}

.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
    margin-top: 20px;
}

.control-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-section h4 {
    margin: 0 0 15px 0;
    text-align: center;
    color: #555;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    text-transform: uppercase;
    font-size: 13px;
}

.op-btn {
    padding: 15px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    width: 100%;
    transition: transform 0.1s;
}

.op-btn:active {
    transform: scale(0.98);
}

.op-btn:disabled {
    background-color: #e0e0e0 !important;
    color: #aaa;
    cursor: not-allowed;
}

.btn-prep-start {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1f2937;
}

.btn-prep-end {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1f2937;
}

.btn-prod-start {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    font-size: 16px;
    padding: 20px;
}

.btn-prod-pause {
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
    color: #1f2937;
}

.btn-prod-stop {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.btn-mal-report {
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
}

.btn-maint-start {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}

.btn-maint-end {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.op-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 10px;
}

/* --- MODAL (Enhanced) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--color-surface);
    padding: var(--space-6);
    border-radius: var(--radius-2xl);
    width: 450px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.2);
    animation: fadeInScale 0.3s ease-out;
    position: relative;
    pointer-events: auto;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success), var(--color-primary));
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.modal-header {
    font-size: var(--font-size-lg);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: var(--space-3);
    padding-top: var(--space-2);
}

.modal-body input,
.modal-body select {
    width: 100%;
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    font-size: var(--font-size-base);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    transition: all var(--transition-base);
}

.modal-body input:focus,
.modal-body select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-light);
}

.modal-body label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--font-size-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-light);
}

.btn-close {
    background: linear-gradient(135deg, var(--color-text-muted) 0%, #7f8c8d 100%);
}

.btn-close:hover {
    background: linear-gradient(135deg, var(--color-text-secondary) 0%, #6c757d 100%);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- TİMELİNE --- */
.timeline-container {
    margin-top: 20px;
    overflow-x: auto;
    border: 1px solid #ddd;
    padding: 20px;
    padding-bottom: 60px;
    background: white;
    border-radius: 5px;
    position: relative;
}

.timeline-row {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 10px;
}

.timeline-label {
    width: 150px;
    font-weight: bold;
    font-size: 13px;
    text-align: right;
    padding-right: 15px;
    border-right: 2px solid #eee;
}

.timeline-bar {
    flex: 1;
    height: 40px;
    background: #f9f9f9;
    position: relative;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.timeline-axis {
    position: absolute;
    bottom: 10px;
    left: 175px;
    right: 20px;
    height: 20px;
    border-top: 2px solid #666;
}

.axis-tick {
    position: absolute;
    top: 5px;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: bold;
    color: #333;
}

.axis-line {
    position: absolute;
    top: -7px;
    left: 50%;
    height: 7px;
    width: 2px;
    background: #666;
}

.event-block {
    position: absolute;
    height: 100%;
    top: 0;
    font-size: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

.event-run {
    background: #2ecc71;
    opacity: 0.9;
}

.event-stop {
    background: #e74c3c;
    opacity: 0.9;
}

.event-pause {
    background: #f1c40f;
    color: #333;
    opacity: 0.9;
}

.event-machine-on {
    background: #3498db;
    opacity: 0.8;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.time-marker-start,
.time-marker-end {
    position: absolute;
    bottom: -25px;
    font-size: 10px;
    font-weight: bold;
    color: #c0392b;
    transform: rotate(-45deg);
    transform-origin: top left;
    white-space: nowrap;
    z-index: 10;
}

.time-marker-start::before,
.time-marker-end::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 2px;
    width: 1px;
    height: 5px;
    background-color: #c0392b;
}

.time-marker-end {
    right: -5px;
    bottom: -25px;
    transform-origin: top right;
}

/* --- DASHBOARD & KARTLAR --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
    align-items: start;
}

.machine-card {
    background: var(--color-surface);
    border-top: 4px solid var(--color-primary);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    border-top-width: 4px;
    transition: all var(--transition-base);
}

.machine-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.machine-card h3 {
    font-size: var(--font-size-md);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2) 0;
}

.card-running {
    background-color: #d4edda !important;
    border-top-color: #28a745 !important;
}

.card-paused {
    background-color: #fff3cd !important;
    border-top-color: #ffc107 !important;
}

.card-maintenance {
    background-color: #ffe5d0 !important;
    border-top-color: #e67e22 !important;
}

.card-offline {
    background-color: #f2f2f2 !important;
    border-top-color: #95a5a6 !important;
    opacity: 0.8;
}

/* Offline */
.blink-red {
    background-color: #fadbd8;
    border-top-color: #c0392b !important;
    animation: blinkRed 1s infinite;
}

.blink-name-red {
    color: #c0392b !important;
    animation: blinkText 1s infinite;
    font-weight: bold;
    font-size: 18px !important;
}

@keyframes blinkText {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

@keyframes blinkRed {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.job-info {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #2c3e50;
    border-left: 4px solid #e67e22;
}

.status-list {
    margin-top: 15px;
    list-style: none;
    padding: 0;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-active {
    background-color: #2ecc71;
    box-shadow: 0 0 5px #2ecc71;
}

.status-passive {
    background-color: #bdc3c7;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: white;
    font-weight: bold;
}

.status-wait {
    background-color: #95a5a6;
}

.status-process {
    background-color: #27ae60;
}

.status-paused {
    background-color: #f1c40f;
    color: #333;
}

.status-done {
    background-color: #2c3e50;
}

/* --- BAKIM PANELİ - TABLO STİLLERİ --- */
.maintenance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.maintenance-table th {
    background-color: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    border-bottom: 2px solid #ddd;
}

.maintenance-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.maintenance-table tr:hover {
    background-color: #f9f9f9;
}

/* Bakım tablosu satır animasyonları */
.row-fault,
.blink-red-row {
    background-color: #fadbd8 !important;
    animation: blinkRed 1s infinite;
}

.row-repair {
    background-color: #d6e9f5 !important;
    animation: blinkBlue 1.5s infinite;
}

.row-maintenance {
    background-color: #ffe5d0 !important;
}

/* Mavi yanıp sönme - Onarım durumu için */
.blink-blue {
    background-color: #d6e9f5;
    border-top-color: #3498db !important;
    animation: blinkBlue 1.5s infinite;
}

@keyframes blinkBlue {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* Grup badge */
.group-badge {
    background-color: #ecf0f1;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #555;
    font-weight: 600;
}

/* Aksiyon butonları */
.action-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-action-icon {
    padding: 8px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-fault {
    background-color: #e74c3c;
}

.btn-fault:hover {
    background-color: #c0392b;
}

.btn-repair-start {
    background-color: #3498db;
}

.btn-repair-start:hover {
    background-color: #2980b9;
}

.btn-repair-end {
    background-color: #27ae60;
}

.btn-repair-end:hover {
    background-color: #229954;
}

.btn-fix {
    background-color: #27ae60;
}

.btn-fix:hover {
    background-color: #229954;
}

.btn-maint-start {
    background-color: #e67e22;
}

.btn-maint-start:hover {
    background-color: #d35400;
}

.btn-maint-end {
    background-color: #16a085;
}

.btn-maint-end:hover {
    background-color: #138d75;
}

/* Departman badge */
.dept-badge {
    background-color: #e8f5e9;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #2e7d32;
    font-weight: 600;
    margin-left: 5px;
}

/* ============================================
   RESPONSIVE DESIGN - TABLET & MOBILE
   ============================================ */

/* --- TABLET (≤ 1024px) --- */
@media screen and (max-width: 1024px) {

    /* Header */
    header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 15px;
    }

    header h1 {
        font-size: 1.3em;
    }

    /* Container */
    .container {
        padding: 15px;
        max-width: 100%;
    }

    .monitor-container {
        padding: 10px;
        width: 100%;
    }

    /* Dashboard Grid */
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }

    /* Tablolar */
    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 10px;
    }

    /* Operatör Panel */
    .control-panel {
        flex-wrap: wrap;
    }

    .control-section {
        min-width: 200px;
    }

    /* Timeline */
    .timeline-label {
        width: 100px;
        font-size: 11px;
    }

    .timeline-axis {
        left: 120px;
    }

    /* User item grid */
    .user-item {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Modal */
    .modal-content {
        width: 90%;
        max-width: 500px;
    }
}

/* --- MOBILE (≤ 768px) --- */
@media screen and (max-width: 768px) {

    /* Header - Dikey layout */
    header {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }

    header>div {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    header h1 {
        font-size: 1.1em;
        margin: 0;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .monitor-btn,
    .logout-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .license-badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* Container */
    .container {
        padding: 10px;
    }

    /* Dashboard Grid - Tek sütun */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .machine-card {
        padding: 15px;
    }

    .machine-card h3 {
        font-size: 1.1em;
    }

    /* Operatör Panel */
    .op-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .control-panel {
        flex-direction: column;
        gap: 15px;
    }

    .control-section {
        width: 100%;
        min-width: auto;
    }

    .op-btn {
        padding: 12px;
        font-size: 13px;
    }

    .btn-prod-start {
        font-size: 14px;
        padding: 15px;
    }

    .op-header-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Tablolar - Yatay scroll */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 12px;
    }

    th,
    td {
        padding: 8px;
    }

    /* Tab buttons */
    .tab-container {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-btn {
        flex: 1;
        min-width: 120px;
        font-size: 12px;
        padding: 8px;
    }

    /* Login */
    .login-container {
        width: 90% !important;
        padding: 25px;
    }

    /* Timeline */
    .timeline-container {
        padding: 10px;
        padding-bottom: 50px;
    }

    .timeline-row {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 20px;
    }

    .timeline-label {
        width: 100%;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 5px 0;
        margin-bottom: 5px;
    }

    .timeline-bar {
        width: 100%;
        height: 35px;
    }

    .timeline-axis {
        left: 10px;
        right: 10px;
    }

    /* Modal - Tam genişlik */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        margin: 5vh auto;
    }

    .modal-body {
        flex-direction: column !important;
    }

    /* User item grid */
    .user-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* List item */
    .item-header {
        flex-direction: column;
        gap: 10px;
    }

    /* Form grids */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Flex row to column */
    [style*="display:flex"][style*="gap"] {
        flex-wrap: wrap;
    }

    /* Action groups */
    .action-group {
        justify-content: center;
    }

    .btn-action-icon {
        padding: 6px 8px;
        font-size: 11px;
    }

    /* Status text */
    #currentStatusText {
        font-size: 18px !important;
    }

    /* Select & Input */
    select,
    input {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* --- SMALL MOBILE (≤ 480px) --- */
@media screen and (max-width: 480px) {
    header h1 {
        font-size: 0.95em;
    }

    .license-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .container {
        padding: 8px;
    }

    /* Dashboard */
    .machine-card {
        padding: 12px;
    }

    .machine-card h3 {
        font-size: 1em;
    }

    .job-info {
        font-size: 11px;
        padding: 8px;
    }

    .status-item {
        font-size: 0.8em;
        padding: 6px;
    }

    /* Buttons */
    button {
        font-size: 12px;
        padding: 6px 10px;
    }

    .op-btn {
        padding: 10px;
        font-size: 12px;
    }

    .btn-prod-start {
        font-size: 13px;
        padding: 12px;
    }

    /* Tab buttons */
    .tab-btn {
        min-width: 100px;
        font-size: 11px;
        padding: 6px;
    }

    /* Modal */
    .modal-content {
        padding: 15px;
    }

    .modal-header {
        font-size: 14px;
    }

    .modal-body input,
    .modal-body select {
        font-size: 14px;
        padding: 8px;
    }

    /* Tables */
    th,
    td {
        padding: 6px;
        font-size: 11px;
    }

    /* Badge */
    .badge,
    .role-badge {
        font-size: 10px;
        padding: 3px 6px;
    }

    /* Login */
    .login-container {
        padding: 20px;
    }

    .login-container input,
    .login-container button {
        padding: 10px;
        font-size: 13px;
    }

    /* Status text */
    #currentStatusText {
        font-size: 16px !important;
    }

    /* Hide non-essential elements */
    .monitor-btn {
        display: none;
    }

    /* Profile section */
    #userProfileSection {
        padding: 3px 8px !important;
    }

    #userProfileSection img {
        width: 28px !important;
        height: 28px !important;
    }

    #userProfileSection span {
        font-size: 12px !important;
    }
}

/* --- LANDSCAPE MOBILE --- */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .control-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .control-section {
        flex: 1 1 45%;
        min-width: 150px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- PRINT STYLES --- */
@media print {

    header,
    .tab-container,
    button,
    .modal {
        display: none !important;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    table {
        width: 100%;
        font-size: 10pt;
    }
}