﻿
        * { margin: 0; padding: 0; box-sizing: border-box; }
        :root { --admin-sidebar-width: 300px; }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #000; color: #e2e8f0; min-height: 100vh; overflow-x: hidden;
        }
        .hidden { display: none !important; }

        .btn {
            padding: 12px 28px; border: none; border-radius: 10px;
            font-size: 15px; font-weight: 600; cursor: pointer;
            transition: all .3s; letter-spacing: .5px;
        }
        .btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
        .btn-primary { background: linear-gradient(135deg, #8B1A1A, #7f1d1d); color: #fff; }
        .btn-danger  { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
        .btn-secondary { background: linear-gradient(135deg, #475569, #334155); color: #fff; }
        .btn-accent { background: linear-gradient(135deg, #c0392b, #a93226); color: #fff; }
        .btn-sm { padding: 8px 18px; font-size: 13px; }

        input[type="text"], input[type="password"], input[type="number"] {
            width: 100%; padding: 12px 16px;
            border: 2px solid #3d1f1f; border-radius: 10px;
            background: #120d0d; color: #e2e8f0; font-size: 15px;
            transition: border-color .3s;
        }
        input:focus { outline: none; border-color: #8B1A1A; }

        @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

        #loginPage {
            display: flex; justify-content: center; align-items: center; min-height: 100vh;
            background:
                radial-gradient(1200px 500px at 15% 20%, rgba(139, 26, 26, 0.18), transparent 60%),
                radial-gradient(800px 400px at 90% 80%, rgba(239, 68, 68, 0.12), transparent 60%),
                linear-gradient(135deg, #050404 0%, #0f0a0a 45%, #050404 100%);
            font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            position: relative;
            overflow: hidden;
            isolation: isolate;
        }
        #loginPage::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: 0;
            background:
                linear-gradient(120deg, rgba(0, 0, 0, 0.78), rgba(20, 8, 8, 0.68)),
                url('/static/world_map.jpg') center/cover no-repeat;
            opacity: 0.5;
            filter: grayscale(0.25) contrast(1.05) saturate(0.85);
            transform: scale(1.03);
        }
        #loginPage::after {
            content: none;
        }
        .login-flow-layer {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 8;
            pointer-events: none;
            opacity: 0.72;
            mix-blend-mode: screen;
        }
        .login-flow-layer .flow-group {
            transform-origin: 56% 26.8%;
            animation: flowDrift 14s ease-in-out infinite;
        }
        .login-flow-layer .path-glow {
            fill: none;
            stroke: rgba(255, 49, 49, 0.26);
            stroke-width: 8.5;
            filter: blur(6px);
        }
        .login-flow-layer .data-path {
            fill: none;
            stroke: #ff3131;
            stroke-width: 3.2;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-dasharray: 16 32;
            stroke-dashoffset: 0;
            animation: flowAnimation var(--flow-speed, 2.8s) linear infinite;
            filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.65));
        }
        .login-flow-layer .data-path.path-fast { --flow-speed: 2.1s; }
        .login-flow-layer .data-path.path-mid { --flow-speed: 2.9s; }
        .login-flow-layer .data-path.path-slow { --flow-speed: 3.8s; }

        .login-flow-layer .origin-dot {
            fill: #ff0000;
            filter: drop-shadow(0 0 14px rgba(255, 0, 0, 0.85));
            animation: originPulse 1.7s infinite cubic-bezier(0.4, 0, 0.6, 1);
        }

        .login-shell {
            width: min(980px, 92vw); min-height: 560px; position: relative;
            transform: translateY(40px);
            z-index: 3;
        }
        .login-card {
            position: relative; width: 100%; min-height: 560px;
            background: rgba(8, 8, 8, 0.38); border-radius: 26px;
            border: 1px solid rgba(255,255,255,.1);
            box-shadow: 0 40px 120px rgba(0,0,0,.75);
            overflow: hidden;
            backdrop-filter: blur(12px) saturate(1.1);
            -webkit-backdrop-filter: blur(12px) saturate(1.1);
            --login-slide-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
            --login-fade-ease: cubic-bezier(0.32, 0.72, 0, 1);
            --login-slide-duration: 420ms;
            --login-fade-duration: 220ms;
        }

        @keyframes flowAnimation {
            from { stroke-dashoffset: 140; }
            to { stroke-dashoffset: 0; }
        }

        @keyframes originPulse {
            0% { r: 8; opacity: 1; }
            50% { r: 16; opacity: 0.24; }
            100% { r: 8; opacity: 1; }
        }

        @keyframes flowDrift {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.01); }
        }

        .login-message {
            position: absolute; top: 18px; left: 25%; transform: translateX(-50%);
            width: 46%; z-index: 30;
            transition: left var(--login-fade-duration) var(--login-fade-ease), opacity var(--login-fade-duration) var(--login-fade-ease);
        }
        .login-card.right-panel-active .login-message { left: 75%; }
        .login-message .message { text-align: center; }
        .login-logo-stack {
            display: flex; flex-direction: column; gap: 6px; align-items: center;
            margin-bottom: 18px; text-align: center;
        }
        .login-logo-row { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
        .login-logo { height: 46px; width: auto; }
        .login-brand { font-size: 30px; font-weight: 700; letter-spacing: -1px; color: #f8fafc; }
        .login-title {
            font-size: 18px; font-weight: 700; color: #e74c3c; text-transform: uppercase; letter-spacing: 1px;
        }
        .login-subtitle { font-size: 12px; color: #64748b; letter-spacing: .6px; }

        .login-form-wrap { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
        .login-card .form-group label {
            font-size: 10px; font-weight: 700; color: #64748b; letter-spacing: 1.3px;
        }
        .login-card input[type="text"],
        .login-card input[type="password"] {
            background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.08);
            color: #f8fafc; padding: 12px 14px; border-radius: 12px; font-size: 14px;
        }
        .login-card input:focus { border-color: #8B1A1A; box-shadow: 0 0 18px rgba(139, 26, 26, 0.22); }

        .login-primary-btn {
            background: linear-gradient(135deg, #8B1A1A, #6b1111); border: none; color: #fff;
            padding: 13px 16px; border-radius: 12px; font-weight: 700; letter-spacing: .8px;
            cursor: pointer; transition: all .3s; text-transform: uppercase;
        }
        .login-primary-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(139,26,26,.35); }
        .login-link {
            font-size: 11px; color: #94a3b8; text-decoration: none; margin-top: 2px; display: inline-block;
            background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
        }
        .login-link:hover { color: #f8fafc; }

        .form-container {
            position: absolute; top: 0; height: 100%; width: 50%;
            display: flex; flex-direction: column; justify-content: center;
            padding: 46px 56px;
            transition: transform var(--login-slide-duration) var(--login-slide-ease),
                        opacity var(--login-fade-duration) var(--login-fade-ease),
                        z-index 0s linear;
            will-change: transform, opacity;
            backface-visibility: hidden;
        }
        .sign-in-container { left: 0; z-index: 2; opacity: 1; }
        .login-card.right-panel-active .sign-in-container {
            transform: translateX(100%);
            opacity: 0;
            z-index: 1;
            transition-delay: 0ms, 80ms, 0ms;
        }

        .sign-up-container { left: 0; opacity: 0; z-index: 1; }
        .login-card.right-panel-active .sign-up-container {
            transform: translateX(100%);
            opacity: 1;
            z-index: 5;
            transition-delay: 0ms, 120ms, 0ms;
        }

        .overlay-container {
            position: absolute; top: 0; left: 50%; width: 50%; height: 100%;
            overflow: hidden;
            transition: transform var(--login-slide-duration) var(--login-slide-ease);
            z-index: 10;
            will-change: transform;
            backface-visibility: hidden;
        }
        .login-card.right-panel-active .overlay-container { transform: translateX(-100%); }

        .overlay {
            background: linear-gradient(135deg, #7f1d1d 0%, #000 100%);
            color: #fff; position: relative; left: -100%; height: 100%; width: 200%;
            transform: translateX(0);
            transition: transform var(--login-slide-duration) var(--login-slide-ease);
            will-change: transform;
            backface-visibility: hidden;
        }
        .login-card.right-panel-active .overlay { transform: translateX(50%); }

        .overlay-panel {
            position: absolute; display: flex; align-items: center; justify-content: center;
            flex-direction: column; padding: 0 46px; text-align: center;
            top: 0; height: 100%; width: 50%;
            transition: transform var(--login-slide-duration) var(--login-slide-ease),
                        opacity var(--login-fade-duration) var(--login-fade-ease);
            will-change: transform, opacity;
        }
        .overlay-panel h2 { font-size: 26px; margin-bottom: 10px; font-weight: 700; }
        .overlay-panel p { font-size: 13px; opacity: .7; line-height: 1.6; }
        .overlay-left { transform: translateX(-20%); }
        .login-card.right-panel-active .overlay-left { transform: translateX(0); }
        .overlay-right { right: 0; transform: translateX(0); }
        .login-card.right-panel-active .overlay-right { transform: translateX(20%); }

        .login-ghost-btn {
            margin-top: 20px; padding: 10px 36px; border: 2px solid #fff; border-radius: 999px;
            background: transparent; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .8px;
            text-transform: uppercase; cursor: pointer; transition: all .3s;
        }
        .login-ghost-btn:hover { background: #fff; color: #7f1d1d; }

        .login-switch-note { font-size: 11px; color: #94a3b8; margin-top: 10px; text-align: center; }
        .login-switch-note button {
            border: none; background: none; color: #e74c3c; font-weight: 700; cursor: pointer;
        }

        @media (max-width: 900px) {
            #loginPage { background: #000 !important; }
            #loginPage::before { display: none; }
            .login-card { min-height: 640px; }
            .login-flow-layer { display: none; opacity: 0; }
            .form-container {
                width: 100%;
                padding: 38px 32px;
                position: relative;
                left: 0;
                transform: none !important;
                transition: none !important;
                animation: none !important;
            }
            .overlay-container { display: none; }
            .sign-in-container { display: flex; opacity: 1; z-index: 2; }
            .sign-up-container { display: none; opacity: 1; z-index: 2; }
            .login-card.right-panel-active .sign-in-container { display: none; }
            .login-card.right-panel-active .sign-up-container { display: flex; }
            .login-message { left: 50%; width: min(420px, 92%); top: 14px; }
            .login-card.right-panel-active .login-message { left: 50%; }
        }
        .form-group { margin-bottom: 18px; }
        .form-group label {
            display: block; margin-bottom: 6px; font-weight: 600; color: #94a3b8;
            font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
        }
        .login-tabs { display: flex; margin-bottom: 25px; border-bottom: 2px solid #3d1f1f; }
        .login-tabs button {
            flex: 1; padding: 12px; background: transparent; border: none;
            color: #64748b; font-size: 15px; font-weight: 600; cursor: pointer;
            transition: all .3s; position: relative;
        }
        .login-tabs button.active { color: #8B1A1A; }
        .login-tabs button.active::after {
            content: ''; position: absolute; bottom: -2px; left: 0;
            width: 100%; height: 2px; background: #8B1A1A;
        }
        .message { padding: 10px 14px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; text-align: center; }
        .message.error { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
        .message.success { background: rgba(16,185,129,.1); color: #34d399; border: 1px solid rgba(16,185,129,.25); }

        #mainPage { min-height: 100vh; display: flex; flex-direction: column; }
        .topbar {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 30px; background: rgba(18,13,13,.97);
            border-bottom: 1px solid #3d1f1f; backdrop-filter: blur(10px);
            position: sticky; top: 0; z-index: 100;
        }
        .topbar-logo img { height: 36px; width: auto; }
        .topbar-user { display: flex; align-items: center; gap: 15px; }
        .topbar-user span { color: #94a3b8; }

        .user-dropdown-wrapper { position: relative; }
        .user-dropdown-trigger {
            display: flex; align-items: center; gap: 8px; cursor: pointer;
            padding: 6px 14px; border-radius: 10px; transition: all .3s; border: 1px solid transparent;
        }
        .user-dropdown-trigger:hover { background: rgba(139,26,26,.08); border-color: #3d1f1f; }
        .user-dropdown-trigger .arrow { font-size: 10px; color: #8B1A1A; transition: transform .3s; }
        .user-dropdown-trigger.open .arrow { transform: rotate(180deg); }
        .user-dropdown {
            display: none; position: absolute; top: calc(100% + 8px); right: 0;
            background: #1a1010; border: 1px solid #3d1f1f; border-radius: 12px;
            min-width: 220px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
            overflow: hidden; z-index: 150; animation: fadeInUp .2s;
        }
        .user-dropdown.open { display: block; }
        .user-dropdown-item {
            display: block; padding: 12px 16px;
            cursor: pointer; transition: all .2s; color: #e2e8f0; font-size: 14px;
            border-bottom: 1px solid #251515;
        }
        .user-dropdown-item:last-child { border-bottom: none; }
        .user-dropdown-item:hover { background: rgba(139,26,26,.08); color: #e74c3c; }
        .user-dropdown-item.danger { color: #f87171; }
        .user-dropdown-item.danger:hover { background: rgba(239,68,68,.08); }

        .my-devices-list { max-height: 400px; overflow-y: auto; }
        .my-device-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 16px; background: #120d0d; border-radius: 10px;
            margin-bottom: 10px; transition: all .3s; border: 1px solid #3d1f1f;
        }
        .my-device-row:hover { border-color: #8B1A1A30; background: #1c1010; }
        .my-device-info { flex: 1; cursor: pointer; }
        .my-device-info .dev-name { font-weight: 700; font-size: 15px; color: #fff; margin-bottom: 3px; }
        .my-device-info .dev-serial { font-size: 12px; color: #e74c3c; letter-spacing: 1px; font-weight: 600; }
        .my-device-info .dev-meta { font-size: 11px; color: #64748b; margin-top: 3px; }
        .my-device-delete {
            width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(239,68,68,.25);
            background: rgba(239,68,68,.06); color: #f87171; font-size: 16px;
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            transition: all .3s; flex-shrink: 0; margin-left: 12px;
        }
        .my-device-delete:hover { background: rgba(239,68,68,.15); border-color: #f87171; }
        .my-devices-empty { text-align: center; padding: 40px 20px; color: #64748b; }
        .my-devices-empty .empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }
        .my-devices-count { font-size: 13px; color: #64748b; margin-bottom: 16px; }

        .main-content { max-width: 1100px; margin: 30px auto; padding: 0 20px; flex: 1; }

        .search-section {
            background: rgba(17,27,46,.85); border: 1px solid #3d1f1f;
            border-radius: 16px; padding: 30px; margin-bottom: 30px; text-align: center;
        }
        .search-section h2 { margin-bottom: 6px; font-size: 22px; color: #e2e8f0; }
        .search-section p { color: #64748b; margin-bottom: 20px; font-size: 14px; }
        .search-bar { display: flex; gap: 12px; max-width: 600px; margin: 0 auto; }
        .search-bar input { flex: 1; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }

        .device-chips { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
        .device-chip {
            padding: 6px 14px; background: #120d0d; border: 1px solid #3d1f1f;
            border-radius: 8px; font-size: 13px; color: #e74c3c; cursor: pointer;
            font-weight: 600; letter-spacing: 1px; transition: all .3s;
        }
        .device-chip:hover { background: #251515; border-color: #8B1A1A; }

        .alerts-section { margin-bottom: 25px; }
        .alert-card {
            display: flex; align-items: center; gap: 15px;
            padding: 14px 20px; border-radius: 12px; margin-bottom: 10px;
            cursor: pointer; transition: all .3s; animation: fadeInUp .4s;
        }
        .alert-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
        .alert-card-trip { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); }
        .alert-card-cold { background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.3); }
        .alert-card-icon { font-size: 28px; flex-shrink: 0; }
        .alert-card-body { flex: 1; }
        .alert-card-title { font-weight: 700; font-size: 14px; color: #e2e8f0; margin-bottom: 2px; }
        .alert-card-msg { font-size: 13px; color: #94a3b8; }
        .alert-card-val { font-size: 22px; font-weight: 800; flex-shrink: 0; }
        .alert-card-trip .alert-card-val { color: #f87171; }
        .alert-card-cold .alert-card-val { color: #fbbf24; }

        .device-card {
            background: rgba(17,27,46,.85); border: 1px solid #3d1f1f;
            border-radius: 16px; padding: 30px; margin-bottom: 30px;
            animation: fadeInUp .5s; position: relative;
        }
        @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

        .device-header {
            display: flex; justify-content: space-between; align-items: flex-start;
            flex-wrap: wrap; gap: 15px; margin-bottom: 25px;
            padding-bottom: 20px; border-bottom: 1px solid #3d1f1f;
        }
        .device-title h3 { font-size: 22px; margin-bottom: 4px; color: #f1f5f9; }
        .device-title .serial { color: #e74c3c; font-size: 14px; font-weight: 600; letter-spacing: 1px; }
        .device-header-actions { display: flex; gap: 10px; align-items: center; }
        .device-status {
            padding: 6px 18px; border-radius: 20px; font-size: 13px;
            font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
        }
        .status-aktif { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(16,185,129,.25); }
        .status-uyari { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
        .status-trip  { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.25); }

        .device-type-badge {
            display: inline-block; padding: 4px 12px; border-radius: 8px; font-size: 11px;
            font-weight: 700; letter-spacing: 1px; margin-top: 6px;
        }
        .badge-T { background: rgba(96,165,250,.12); color: #60a5fa; border: 1px solid rgba(96,165,250,.25); }
        .badge-MCHD { background: rgba(168,85,247,.12); color: #a855f7; border: 1px solid rgba(168,85,247,.25); }

        .settings-btn {
            width: 40px; height: 40px; border-radius: 50%; border: 2px solid #3d1f1f;
            background: #120d0d; color: #8B1A1A; font-size: 20px; cursor: pointer;
            display: flex; align-items: center; justify-content: center; transition: all .3s;
        }
        .settings-btn-icon {
            width: 20px;
            height: 20px;
            fill: currentColor;
            stroke: none;
        }
        .settings-btn:hover { border-color: #8B1A1A; background: #251515; transform: rotate(90deg); }

        .settings-panel {
            position: relative;
            background: #120d0d; border: 1px solid #3d1f1f; border-radius: 12px;
            padding: 20px; margin-bottom: 25px; animation: fadeInUp .3s;
        }
        .settings-panel h4 { color: #e74c3c; margin-bottom: 15px; margin-right: 30px; font-size: 16px; }
        .settings-panel-close {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 24px;
            height: 24px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(15, 23, 42, 0.7);
            color: #e2e8f0;
            font-size: 12px;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all .2s;
        }
        .settings-panel-close:hover {
            border-color: rgba(248, 113, 113, 0.8);
            color: #f87171;
            background: rgba(127, 29, 29, 0.45);
        }
        .settings-row { display: flex; gap: 15px; align-items: flex-end; flex-wrap: wrap; }
        .settings-row .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }
        .settings-row .form-group label { font-size: 11px; }
        .settings-row input[type="number"] { padding: 10px 12px; font-size: 14px; }
        .settings-section-title {
            font-size: 13px; font-weight: 700; color: #94a3b8; margin: 15px 0 10px;
            padding-top: 12px; border-top: 1px solid #201414; text-transform: uppercase; letter-spacing: 1px;
        }

        .gauge-section { display: flex; flex-direction: column; align-items: center; }
        .gauge-container { position: relative; width: 480px; max-width: 100%; height: 300px; margin-bottom: 10px; }
        .gauge-canvas { cursor: pointer; width: 100%; height: 100%; display: block; }
        .gauge-value-display { text-align: center; margin-top: -10px; }
        .gauge-value-display .temp-value { font-size: 52px; font-weight: 800; transition: color .3s; }
        .gauge-value-display .temp-unit { font-size: 22px; color: #64748b; margin-left: 4px; }
        .gauge-value-display .temp-status { font-size: 14px; font-weight: 600; margin-top: 4px; letter-spacing: 1px; text-transform: uppercase; }
        .gauge-legend { display: flex; justify-content: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
        .legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; }
        .legend-dot { width: 12px; height: 12px; border-radius: 50%; }
        .gauge-tip { margin-top: 15px; color: #e74c3c; font-size: 13px; text-align: center; font-style: italic; }

        /* MCHD Üçlü Gösterge Düzeni */
        .mchd-gauges { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; margin-top: 20px; }
        .mchd-gauge-box {
            background: #120d0d; border: 1px solid #201414; border-radius: 16px;
            padding: 20px; text-align: center;
        }
        .mchd-gauge-box h4 { color: #94a3b8; font-size: 14px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
        .mchd-gauge-box .gauge-container { width: 300px; height: 200px; margin: 0 auto 8px; }
        .mchd-gauge-box .gauge-value-display .temp-value { font-size: 36px; }
        .mchd-gauge-box .gauge-value-display .temp-unit { font-size: 16px; }
        .mchd-gauge-box .gauge-value-display .temp-status { font-size: 12px; }

        /* Yağ Seviye Tank Göstergesi */
        .oil-tank-container { width: 160px; height: 200px; margin: 0 auto 8px; position: relative; }

        .fault-card {
            margin-top: 26px;
            background: linear-gradient(180deg, rgba(11, 15, 21, 0.95), rgba(9, 12, 18, 0.95));
            border: 1px solid #1f2937;
            border-radius: 18px;
            padding: 20px;
            box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 10px 30px rgba(0,0,0,.38);
        }
        .fault-card.hidden { display: none !important; }
        .fault-card-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            border-bottom: 1px solid #1f2937;
            padding-bottom: 14px;
            margin-bottom: 14px;
        }
        .fault-card-title h4 { font-size: 20px; color: #f1f5f9; margin-bottom: 4px; }
        .fault-card-title .serial { color: #a855f7; font-size: 13px; font-weight: 700; letter-spacing: 1px; }
        .fault-badges { display: flex; gap: 8px; flex-wrap: wrap; }
        .fault-badge {
            padding: 5px 12px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 1px;
            text-transform: uppercase;
            border: 1px solid #334155;
            color: #cbd5e1;
            background: rgba(15, 23, 42, 0.7);
        }
        .fault-badge.type { border-color: rgba(168,85,247,.35); color: #c4b5fd; }
        .fault-badge.status-ok { border-color: rgba(16,185,129,.35); color: #34d399; }
        .fault-badge.status-warn { border-color: rgba(251,191,36,.35); color: #fbbf24; }
        .fault-badge.status-trip { border-color: rgba(239,68,68,.35); color: #f87171; }

        .fault-quick-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
        .fault-stat {
            background: rgba(2, 6, 12, 0.45);
            border: 1px solid #1f2937;
            border-radius: 12px;
            padding: 14px;
            text-align: center;
            min-height: 112px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 4px;
        }
        .fault-stat .label { font-size: 11px; color: #64748b; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
        .fault-stat .val { font-size: 34px; font-weight: 800; color: #f8fafc; line-height: 1; }
        .fault-stat .sub { font-size: 12px; color: #94a3b8; font-weight: 600; }
        .fault-stat.danger { border-color: rgba(239,68,68,.35); background: rgba(127,29,29,.12); }
        .fault-stat.danger .val { color: #f87171; font-size: 20px; line-height: 1.2; }
        .fault-stat.latest .val { color: #fbbf24; font-size: 20px; line-height: 1.2; }

        .fault-chart-header {
            margin-bottom: 10px;
            font-size: 14px;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .fault-chart-header::before {
            content: '';
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #3b82f6;
            box-shadow: 0 0 10px #3b82f6;
        }
        .fault-chart-wrap { width: 100%; height: 340px; position: relative; }

        .alarm-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            z-index: 9999; pointer-events: none;
        }
        .alarm-overlay.active { display: block; }
        .alarm-overlay.alarm-cold { animation: flashYellow 1s infinite; border: 6px solid #f59e0b; }
        .alarm-overlay.alarm-trip { animation: flashRed .5s infinite; border: 8px solid #ef4444; }
        @keyframes flashYellow { 0%, 100% { background: rgba(245,158,11,0); } 50% { background: rgba(245,158,11,.06); } }
        @keyframes flashRed { 0%, 100% { background: rgba(239,68,68,0); } 50% { background: rgba(239,68,68,.1); } }

        .alarm-banner {
            margin-top: 25px; padding: 0; border-radius: 16px;
            font-weight: 700; text-align: center; display: none; overflow: hidden;
        }
        .alarm-banner.active { display: block; }
        .alarm-banner-inner { padding: 20px 30px; position: relative; }
        .alarm-banner.alarm-cold-banner .alarm-banner-inner {
            background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(217,119,6,.12));
            border: 2px solid rgba(245,158,11,.4); border-radius: 16px; animation: pulseYellow 1.5s infinite;
        }
        .alarm-banner.alarm-trip-banner .alarm-banner-inner {
            background: linear-gradient(135deg, rgba(239,68,68,.15), rgba(220,38,38,.15));
            border: 3px solid rgba(239,68,68,.5); border-radius: 16px; animation: pulseRed .8s infinite;
        }
        @keyframes pulseYellow { 0%, 100% { box-shadow: 0 0 20px rgba(245,158,11,.2); } 50% { box-shadow: 0 0 40px rgba(245,158,11,.5); } }
        @keyframes pulseRed { 0%, 100% { box-shadow: 0 0 30px rgba(239,68,68,.3); } 50% { box-shadow: 0 0 60px rgba(239,68,68,.7); } }
        .alarm-icon { font-size: 40px; display: block; margin-bottom: 8px; }
        .alarm-title { font-size: 22px; margin-bottom: 6px; letter-spacing: 2px; }
        .alarm-detail { font-size: 14px; opacity: .85; font-weight: 500; }
        .alarm-cold-banner .alarm-title { color: #fbbf24; }
        .alarm-cold-banner .alarm-detail { color: #fcd34d; }
        .alarm-trip-banner .alarm-title { color: #f87171; }
        .alarm-trip-banner .alarm-detail { color: #fca5a5; }

        .modal-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,.6); z-index: 200; justify-content: center; align-items: center;
            backdrop-filter: blur(4px);
        }
        .modal-overlay.active { display: flex; }
        .modal {
            background: #1a1010; border: 1px solid #3d1f1f; border-radius: 20px;
            position: relative;
            padding: 35px; width: 500px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
            box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: fadeInUp .3s;
        }
        .modal h2 { margin-bottom: 20px; margin-right: 38px; font-size: 20px; color: #e74c3c; }
        .modal-close-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 28px;
            height: 28px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(15, 23, 42, 0.7);
            color: #e2e8f0;
            font-size: 14px;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all .2s;
        }
        .modal-close-btn:hover {
            border-color: rgba(248, 113, 113, 0.8);
            color: #f87171;
            background: rgba(127, 29, 29, 0.45);
        }
        .modal .form-group { margin-bottom: 14px; }
        .modal-actions { display: flex; gap: 12px; margin-top: 20px; }
        .modal-actions .btn { flex: 1; }

        .view-all-btn {
            margin-top: 16px; padding: 10px 30px; border: 2px solid #8B1A1A;
            background: rgba(139,26,26,.08); color: #e74c3c; border-radius: 10px;
            font-size: 14px; font-weight: 700; cursor: pointer; transition: all .3s; letter-spacing: .5px;
        }
        .view-all-btn:hover { background: rgba(139,26,26,.18); transform: translateY(-2px); }
        .report-btn {
            margin-top: 10px;
            width: 100%;
            padding: 10px 16px;
            border: 1px solid #334155;
            background: linear-gradient(135deg, rgba(30,64,175,0.2), rgba(15,23,42,0.65));
            color: #bfdbfe;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 700;
            letter-spacing: .5px;
            cursor: pointer;
        }
        .report-btn:hover { border-color: #60a5fa; color: #dbeafe; }

        .report-modal-types {
            display: grid;
            gap: 10px;
            margin-top: 14px;
        }
        .report-type-btn {
            border: 1px solid #334155;
            border-radius: 12px;
            background: rgba(15, 23, 42, 0.75);
            color: #cbd5e1;
            text-align: left;
            padding: 12px;
            cursor: pointer;
            transition: all .2s;
        }
        .report-type-btn.active,
        .report-type-btn:hover {
            border-color: #60a5fa;
            background: rgba(30, 64, 175, 0.2);
            color: #e2e8f0;
        }
        .report-type-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
        .report-type-sub { font-size: 12px; color: #94a3b8; }

        .all-devices-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
        }
        .all-devices-header h2 { font-size: 22px; color: #e2e8f0; }
        .all-devices-header .count-badge {
            padding: 4px 14px; border-radius: 20px; font-size: 13px;
            background: rgba(139,26,26,.12); color: #e74c3c; border: 1px solid rgba(139,26,26,.25); font-weight: 600;
        }
        .back-to-search {
            padding: 8px 22px; border: 1px solid #3d1f1f; background: #120d0d;
            color: #94a3b8; border-radius: 8px; font-size: 13px; font-weight: 600;
            cursor: pointer; transition: all .3s;
        }
        .back-to-search:hover { border-color: #8B1A1A; color: #e74c3c; }
        .all-devices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 24px; }
        .mini-device-card {
            background: rgba(17,27,46,.85); border: 1px solid #3d1f1f;
            border-radius: 16px; padding: 24px; animation: fadeInUp .5s; transition: border-color .3s;
        }
        .mini-device-card:hover { border-color: #8B1A1A30; }
        .mini-card-header {
            display: flex; justify-content: space-between; align-items: flex-start;
            margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #201414;
        }
        .mini-card-title h4 { font-size: 17px; color: #f1f5f9; margin-bottom: 3px; }
        .mini-card-title .mini-serial { font-size: 12px; color: #e74c3c; font-weight: 600; letter-spacing: 1px; }
        .mini-card-status { padding: 4px 12px; border-radius: 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
        .mini-info-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
        .mini-info-tag {
            padding: 4px 10px; background: #120d0d; border-radius: 6px;
            font-size: 11px; color: #94a3b8; border: 1px solid #201414;
        }
        .mini-info-tag b { color: #e2e8f0; font-weight: 600; }
        .mini-gauge-section { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
        .mini-gauge-canvas { cursor: default; }
        .mini-gauge-data { flex: 1; min-width: 140px; }
        .mini-temp-display { font-size: 38px; font-weight: 800; line-height: 1; }
        .mini-temp-unit { font-size: 16px; color: #64748b; }
        .mini-temp-status { font-size: 12px; font-weight: 600; margin-top: 6px; text-transform: uppercase; letter-spacing: 1px; }
        .mini-alarm-info { margin-top: 12px; font-size: 12px; color: #64748b; line-height: 1.8; }
        .mini-alarm-info span { font-weight: 600; }
        .mini-card-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid #201414; text-align: right; }
        .mini-detail-btn {
            padding: 6px 16px; border: 1px solid #3d1f1f; background: transparent;
            color: #e74c3c; border-radius: 8px; font-size: 12px; font-weight: 600;
            cursor: pointer; transition: all .3s;
        }
        .mini-detail-btn:hover { background: rgba(139,26,26,.1); border-color: #8B1A1A; }
        .all-devices-empty { text-align: center; padding: 60px 20px; color: #64748b; grid-column: 1 / -1; }

        .app-footer {
            text-align: center; padding: 20px; margin-top: auto;
            border-top: 1px solid #3d1f1f; color: #475569; font-size: 13px; letter-spacing: .5px;
        }
        .app-footer span { color: #8B1A1A; font-weight: 700; }

        .loading-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(12,8,8,.95); z-index: 10000;
            justify-content: center; align-items: center; flex-direction: column; gap: 20px;
        }
        .loading-overlay.active { display: flex; }
        .loading-spinner {
            width: 48px; height: 48px; border: 4px solid #3d1f1f;
            border-top-color: #8B1A1A; border-radius: 50%; animation: spin .8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loading-text { color: #94a3b8; font-size: 16px; font-weight: 600; letter-spacing: 1px; }

        /* ADMİN */
        #adminPage { min-height: 100vh; display: flex; flex-direction: column; background: #080505; overflow-x: hidden; }
        .admin-topbar {
            display: flex; justify-content: space-between; align-items: center;
            padding: 14px 28px; background: linear-gradient(135deg, #0e0808, #1a1010);
            border-bottom: 2px solid #3d1f1f; position: sticky; top: 0; z-index: 100;
        }
        .admin-topbar-brand { display: flex; align-items: center; gap: 14px; }
        .admin-mobile-menu-btn {
            display: none;
            width: 48px;
            height: 42px;
            border-radius: 12px;
            border: 1px solid #3d1f1f;
            background: #120d0d;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 5px;
            cursor: pointer;
            padding: 0;
        }
        .admin-mobile-menu-btn span {
            width: 22px;
            height: 2px;
            border-radius: 999px;
            background: #e2e8f0;
            display: block;
        }
        .admin-mobile-menu-btn:hover { border-color: #8B1A1A; }
        .admin-sidebar-close-btn {
            display: none;
            width: 28px;
            height: 28px;
            border: 1px solid #334155;
            background: rgba(10, 10, 10, 0.92);
            color: #e2e8f0;
            border-radius: 999px;
            padding: 0;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            line-height: 1;
        }
        .admin-sidebar-close-btn:hover {
            border-color: #f87171;
            color: #f87171;
            background: rgba(127, 29, 29, 0.45);
        }
        .admin-topbar-brand .admin-logo { height: 40px; width: auto; }
        .admin-topbar-brand h1 {
            font-size: 20px; background: linear-gradient(135deg, #e74c3c, #c0392b);
            background-clip: text;
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
        }
        .admin-topbar-brand .admin-subtitle { font-size: 11px; color: #475569; text-transform: uppercase; letter-spacing: 2px; }
        .admin-topbar-right { display: flex; align-items: center; gap: 16px; }
        .admin-badge {
            padding: 4px 14px; border-radius: 20px; font-size: 11px;
            background: rgba(139,26,26,.12); color: #e74c3c; border: 1px solid rgba(139,26,26,.3);
            font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
        }
        .admin-user-dropdown-wrapper { position: relative; }
        .admin-user-trigger {
            display: flex; align-items: center; gap: 8px; cursor: pointer;
            padding: 7px 14px; border-radius: 10px; border: 1px solid #3d1f1f;
            color: #e2e8f0; background: #120d0d; transition: all .2s;
        }
        .admin-user-trigger:hover { border-color: #8B1A1A; }
        .admin-user-trigger .arrow { font-size: 10px; color: #8B1A1A; transition: transform .2s; }
        .admin-user-trigger.open .arrow { transform: rotate(180deg); }
        .admin-user-menu {
            display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px;
            background: #1a1010; border: 1px solid #3d1f1f; border-radius: 12px;
            box-shadow: 0 12px 40px rgba(0,0,0,.5); overflow: hidden; z-index: 250;
        }
        .admin-user-menu.open { display: block; }
        .admin-user-menu .item {
            display: flex; align-items: center; gap: 10px; padding: 12px 16px;
            border-bottom: 1px solid #251515; cursor: pointer; color: #e2e8f0;
        }
        .admin-user-menu .item:last-child { border-bottom: none; }
        .admin-user-menu .item:hover { background: rgba(139,26,26,.08); color: #e74c3c; }
        .admin-user-menu .item.danger { color: #f87171; }
        .admin-user-menu .item.danger:hover { background: rgba(239,68,68,.08); }
        .admin-req-count {
            margin-left: auto; font-size: 11px; font-weight: 700; color: #f87171;
            background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3);
            padding: 2px 8px; border-radius: 12px;
        }
        .admin-logout-btn {
            padding: 8px 20px; border: 1px solid #3d1f1f; background: rgba(239,68,68,.06);
            color: #f87171; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .3s;
        }
        .admin-logout-btn:hover { background: rgba(239,68,68,.15); border-color: #f87171; }
        .admin-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; padding: 24px 28px; }
        .admin-stat-card {
            background: linear-gradient(135deg, #120d0d, #1a1010);
            border: 1px solid #3d1f1f; border-radius: 16px; padding: 22px 24px; position: relative; overflow: hidden;
        }
        .admin-stat-card .stat-icon { font-size: 36px; position: absolute; top: 16px; right: 20px; opacity: .15; }
        .admin-stat-card .stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; }
        .admin-stat-card .stat-value { font-size: 36px; font-weight: 800; color: #f1f5f9; }
        .admin-stat-card.stat-users .stat-value { color: #e74c3c; }
        .admin-stat-card.stat-devices .stat-value { color: #34d399; }
        .admin-stat-card.stat-alarms .stat-value { color: #f87171; }
        .admin-body { display: flex; flex: 1; min-height: 0; }
        .admin-mobile-sidebar-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.62);
            z-index: 320;
        }
        .admin-sidebar {
            width: var(--admin-sidebar-width); min-width: var(--admin-sidebar-width); max-width: 520px; background: #0d0808;
            border-right: 1px solid #3d1f1f; display: flex; flex-direction: column; overflow: hidden;
        }
        .admin-sidebar-resizer {
            width: 8px;
            flex: 0 0 8px;
            cursor: col-resize;
            background: linear-gradient(180deg, rgba(148,163,184,0.15), rgba(148,163,184,0.05));
            border-right: 1px solid rgba(31, 41, 55, 0.9);
            border-left: 1px solid rgba(31, 41, 55, 0.9);
            transition: background .2s;
        }
        .admin-sidebar-resizer:hover,
        .admin-sidebar-resizer.active {
            background: linear-gradient(180deg, rgba(59,130,246,0.35), rgba(59,130,246,0.12));
        }
        .admin-sidebar-header { padding: 20px; border-bottom: 1px solid #3d1f1f; }
        .admin-sidebar-header-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .admin-sidebar-header h3 { font-size: 15px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px; }
        .admin-broadcast-btn {
            border: 1px solid rgba(59,130,246,.35);
            background: rgba(59,130,246,.12);
            color: #93c5fd;
            border-radius: 8px;
            padding: 5px 9px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: .5px;
            text-transform: uppercase;
            cursor: pointer;
            white-space: nowrap;
        }
        .admin-broadcast-btn:hover {
            background: rgba(59,130,246,.2);
            border-color: rgba(59,130,246,.55);
        }
        .admin-user-list { flex: 1; overflow-y: auto; padding: 12px; }
        .admin-user-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 16px; background: #120d0d; border: 1px solid #201414;
            border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: all .3s;
        }
        .admin-user-item:hover { border-color: #8B1A1A40; background: #1c1010; }
        .admin-user-item.active { border-color: #8B1A1A; background: #1c1010; }
        .admin-user-item .aui-name { font-weight: 700; font-size: 15px; color: #e2e8f0; }
        .admin-user-item .aui-username { font-size: 12px; color: #64748b; margin-top: 2px; }
        .admin-user-item .aui-badges { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
        .aui-badge { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
        .aui-badge.devices { background: rgba(52,211,153,.1); color: #34d399; border: 1px solid rgba(52,211,153,.2); }
        .aui-badge.alarms { background: rgba(248,113,113,.1); color: #f87171; border: 1px solid rgba(248,113,113,.2); }
        .admin-main { flex: 1; min-width: 0; padding: 24px 28px; overflow-y: auto; }
        .admin-main-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #334155; }
        .admin-main-placeholder .amp-icon { font-size: 80px; margin-bottom: 20px; opacity: .3; }
        .admin-main-placeholder .amp-text { font-size: 18px; font-weight: 600; }
        .admin-main-placeholder .amp-sub { font-size: 13px; color: #475569; margin-top: 8px; }
        .admin-user-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
        .admin-user-header h2 { font-size: 22px; color: #e2e8f0; }
        .admin-user-header .auh-badge { padding: 4px 14px; border-radius: 20px; font-size: 13px; background: rgba(139,26,26,.12); color: #e74c3c; border: 1px solid rgba(139,26,26,.25); font-weight: 600; }
        .admin-devices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 20px; }
        .admin-mini-card { background: rgba(17,27,46,.85); border: 1px solid #3d1f1f; border-radius: 16px; padding: 22px; animation: fadeInUp .4s; }
        .admin-mini-card .amc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #201414; }
        .admin-mini-card .amc-title h4 { font-size: 16px; color: #f1f5f9; margin-bottom: 2px; }
        .admin-mini-card .amc-title .amc-serial { font-size: 12px; color: #e74c3c; font-weight: 600; letter-spacing: 1px; }
        .admin-mini-card .amc-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
        .admin-mini-card .amc-tag { padding: 3px 10px; background: #120d0d; border-radius: 6px; font-size: 11px; color: #94a3b8; border: 1px solid #201414; }
        .admin-mini-card .amc-tag b { color: #e2e8f0; }
        .admin-mini-card .amc-gauge-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
        .admin-mini-card .amc-gauge-data { flex: 1; min-width: 130px; }
        .admin-mini-card .amc-temp { font-size: 34px; font-weight: 800; line-height: 1; }
        .admin-mini-card .amc-temp-unit { font-size: 14px; color: #64748b; }
        .admin-mini-card .amc-status-text { font-size: 12px; font-weight: 600; margin-top: 5px; text-transform: uppercase; letter-spacing: 1px; }
        .admin-mini-card .amc-alarm-info { margin-top: 10px; font-size: 12px; color: #64748b; line-height: 1.8; }
        .admin-mini-card .amc-alarm-info span { font-weight: 600; }
        .admin-mini-card .amc-mchd-metrics {
            margin-top: 10px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        .admin-mini-card .amc-metric {
            border: 1px solid #1f2937;
            border-radius: 10px;
            padding: 8px 10px;
            background: rgba(10, 15, 21, 0.9);
        }
        .admin-mini-card .amc-metric-label {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: #94a3b8;
            margin-bottom: 4px;
        }
        .admin-mini-card .amc-metric-value {
            font-size: 16px;
            font-weight: 800;
            line-height: 1.1;
            color: #e2e8f0;
        }
        .admin-mini-card .amc-metric-status {
            margin-top: 3px;
            font-size: 10px;
            letter-spacing: .8px;
            text-transform: uppercase;
            color: #64748b;
            font-weight: 700;
        }
        .admin-mini-card .amc-metric.alarm {
            border-color: rgba(239, 68, 68, 0.45);
            background: rgba(127, 29, 29, 0.16);
            box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12) inset;
        }
        .admin-mini-card .amc-metric.alarm .amc-metric-value,
        .admin-mini-card .amc-metric.alarm .amc-metric-status {
            color: #f87171;
        }
        .admin-no-devices { text-align: center; padding: 60px 20px; color: #475569; grid-column: 1 / -1; }
        .admin-footer { text-align: center; padding: 16px; border-top: 1px solid #3d1f1f; color: #334155; font-size: 12px; }
        .admin-footer span { color: #8B1A1A; font-weight: 700; }
        .serial-pill-wrap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
        .serial-pill {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 6px 10px; border-radius: 8px; background: #120d0d;
            border: 1px solid #3d1f1f; font-size: 12px; color: #e2e8f0;
        }
        .serial-pill .remove {
            cursor: pointer; color: #f87171; font-weight: 700;
            width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
            border-radius: 50%; background: rgba(239,68,68,.08);
        }
        .serial-pill .remove:hover { background: rgba(239,68,68,.2); }
        .admin-modal-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
        @media (max-width: 760px) { .admin-modal-grid { grid-template-columns: 1fr; } }
        .req-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
        .req-toolbar input, .req-toolbar select {
            min-width: 180px;
            padding: 10px 12px;
            border: 1px solid #3d1f1f;
            border-radius: 8px;
            background: #120d0d;
            color: #e2e8f0;
        }
        .req-list { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
        .serial-list { display: grid; gap: 10px; max-height: 460px; overflow-y: auto; padding-right: 6px; }
        .serial-user-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
        .serial-user-btn {
            padding: 6px 12px; border-radius: 999px; border: 1px solid #3d1f1f;
            background: #120d0d; color: #e2e8f0; font-size: 12px; font-weight: 700;
            cursor: pointer; transition: all .2s;
        }
        .serial-user-btn.active { border-color: #8B1A1A; color: #e74c3c; background: rgba(139,26,26,.12); }
        .serial-user-btn:hover { border-color: #8B1A1A; }
        .req-item {
            background: #120d0d; border: 1px solid #3d1f1f; border-radius: 12px;
            padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center;
        }
        .serial-row {
            display: grid; grid-template-columns: 120px 90px 1.2fr 1.2fr 140px;
            gap: 10px; align-items: center; padding: 10px 12px;
            background: #120d0d; border: 1px solid #3d1f1f; border-radius: 12px;
        }
        .serial-header { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 1px; }
        .serial-cell { font-size: 13px; color: #e2e8f0; }
        .serial-muted { color: #64748b; font-size: 12px; }
        .serial-pill-badge {
            display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
            padding: 4px 10px; border-radius: 10px; border: 1px solid #3d1f1f; background: #120d0d;
        }
        .serial-pill-badge.ok { color: #34d399; border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.08); }
        .serial-pill-badge.miss { color: #fbbf24; border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.08); }
        .serial-list::-webkit-scrollbar { width: 10px; }
        .serial-list::-webkit-scrollbar-track { background: #0f0a0a; border-radius: 8px; }
        .serial-list::-webkit-scrollbar-thumb { background: #3d1f1f; border-radius: 8px; border: 2px solid #0f0a0a; }
        .serial-list::-webkit-scrollbar-thumb:hover { background: #8B1A1A; }
        .req-name { font-weight: 700; color: #e2e8f0; }
        .req-user { font-size: 12px; color: #94a3b8; margin-top: 2px; }
        .req-date { font-size: 11px; color: #64748b; margin-top: 2px; }
        .req-actions { display: flex; gap: 8px; }
        /* ALARM DURUM KUTULARI */
        .alarm-status-boxes { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 25px; }
        .alarm-box {
            flex: 1; min-width: 140px; max-width: 220px;
            background: #120d0d; border: 2px solid #201414; border-radius: 14px;
            padding: 16px 14px; text-align: center; transition: all .3s;
            position: relative; overflow: hidden;
        }
        .alarm-box .ab-label {
            font-size: 11px; font-weight: 700; color: #64748b;
            text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px;
        }
        .alarm-box .ab-value {
            font-size: 22px; font-weight: 800; color: #e2e8f0; margin-bottom: 6px;
        }
        .alarm-box .ab-icon {
            font-size: 28px; display: block; margin-bottom: 4px; opacity: 0;
            transition: opacity .3s;
        }
        .alarm-box.alarm-active { border-color: #ef4444; background: rgba(239,68,68,.06); }
        .alarm-box.alarm-active .ab-icon { opacity: 1; animation: alarmBlink .6s infinite; }
        .alarm-box.alarm-active .ab-label { color: #f87171; }
        .alarm-box.alarm-active .ab-value { color: #f87171; }
        .alarm-box.alarm-ok { border-color: #166534; }
        .alarm-box.alarm-ok .ab-icon { opacity: 1; color: #34d399; }
        .alarm-box.alarm-ok .ab-value { color: #34d399; }
        @keyframes alarmBlink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

        @media (max-width: 800px) {
            .admin-sidebar-resizer { display: none; }
            .mchd-gauges { grid-template-columns: 1fr; }
            .alarm-status-boxes { gap: 8px; }
            .alarm-box { min-width: 100px; padding: 12px 10px; }
            .fault-quick-stats { grid-template-columns: 1fr; }
            .fault-chart-wrap { height: 300px; }
        }
        @media (max-width: 550px) {
            .login-container { width: 95%; padding: 25px; }
            .gauge-container { width: min(100%, 320px); height: 200px; }
            .modal { padding: 25px; }
            .all-devices-grid { grid-template-columns: 1fr; }
            .mchd-gauges { grid-template-columns: 1fr; }
        }

        /* PROFESSIONAL DASHBOARD THEME (non-breaking visual layer) */
        #mainPage { background: #000; }
        #adminPage { background: #000; }
        .topbar {
            background: rgba(6, 8, 12, 0.9);
            border-bottom: 1px solid #111827;
            backdrop-filter: blur(12px);
        }
        .main-content {
            max-width: none;
            width: calc(100% - 24px);
            display: grid;
            grid-template-columns: 280px minmax(0, 1fr);
            gap: 20px;
            margin: 16px 0 20px 12px;
            padding: 0 12px 0 0;
        }
        .search-section {
            grid-column: 1;
            grid-row: 1 / span 4;
            position: sticky;
            top: 68px;
            align-self: start;
            text-align: left;
            background: linear-gradient(180deg, rgba(11, 15, 21, 0.95), rgba(8, 11, 16, 0.95));
            border: 1px solid #1f2937;
            border-radius: 18px;
            padding: 18px 16px;
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
        }
        .search-section h2 { font-size: 18px; margin-bottom: 8px; }
        .search-section p { margin-bottom: 14px; font-size: 12px; }
        .search-bar { display: block; max-width: none; }
        .search-bar input { margin-bottom: 10px; }
        .search-bar .btn { width: 100%; }
        .device-chips {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 8px;
            margin-top: 12px;
            max-height: 330px;
            overflow-y: auto;
            padding-right: 4px;
        }
        .device-chip {
            background: rgba(10, 13, 19, 0.9);
            border: 1px solid #1f2937;
            color: #d1d5db;
            border-radius: 12px;
            width: 100%;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .device-chip:hover { border-color: #334155; color: #f3f4f6; background: rgba(16, 20, 28, 0.95); }
        .device-chips::-webkit-scrollbar,
        .recent-events-list::-webkit-scrollbar,
        .all-devices-grid::-webkit-scrollbar,
        .admin-user-list::-webkit-scrollbar,
        .admin-main::-webkit-scrollbar {
            width: 9px;
            height: 9px;
        }
        .device-chips::-webkit-scrollbar-track,
        .recent-events-list::-webkit-scrollbar-track,
        .all-devices-grid::-webkit-scrollbar-track,
        .admin-user-list::-webkit-scrollbar-track,
        .admin-main::-webkit-scrollbar-track {
            background: #090c12;
            border-radius: 8px;
        }
        .device-chips::-webkit-scrollbar-thumb,
        .recent-events-list::-webkit-scrollbar-thumb,
        .all-devices-grid::-webkit-scrollbar-thumb,
        .admin-user-list::-webkit-scrollbar-thumb,
        .admin-main::-webkit-scrollbar-thumb {
            background: #1f2937;
            border-radius: 8px;
            border: 2px solid #090c12;
        }
        .device-chips::-webkit-scrollbar-thumb:hover,
        .recent-events-list::-webkit-scrollbar-thumb:hover,
        .all-devices-grid::-webkit-scrollbar-thumb:hover,
        .admin-user-list::-webkit-scrollbar-thumb:hover,
        .admin-main::-webkit-scrollbar-thumb:hover {
            background: #334155;
        }
        .alerts-section,
        #allDevicesSection,
        #deviceSection,
        #searchMsg,
        #recentEventsSection {
            grid-column: 2;
            width: 100%;
        }
        .alerts-section {
            background: rgba(10, 13, 18, 0.72);
            border: 1px solid #1f2937;
            border-radius: 16px;
            padding: 14px;
        }
        .device-card,
        .mini-device-card,
        .admin-mini-card {
            background: linear-gradient(180deg, rgba(11, 15, 21, 0.92), rgba(8, 11, 16, 0.92));
            border: 1px solid #1f2937;
            border-radius: 22px;
            box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 10px 30px rgba(0,0,0,.35);
        }
        .recent-events-section {
            margin-bottom: 24px;
            background: linear-gradient(180deg, rgba(11, 15, 21, 0.95), rgba(8, 11, 16, 0.95));
            border: 1px solid #1f2937;
            border-radius: 20px;
            padding: 16px;
        }
        .recent-events-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
        .recent-events-header h3 { color: #e5e7eb; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; }
        .events-sub { color: #6b7280; font-size: 12px; }
        .events-filter { display: flex; gap: 8px; align-items: center; }
        .events-filter-btn {
            border: 1px solid #1f2937;
            background: #0a0f15;
            color: #9ca3af;
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: .5px;
            cursor: pointer;
        }
        .events-filter-btn.active {
            color: #e2e8f0;
            border-color: #334155;
            background: #111827;
        }
        .recent-events-list { max-height: 300px; overflow-y: auto; }
        .event-item {
            display: grid;
            grid-template-columns: 10px 1fr auto;
            gap: 10px;
            align-items: center;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid #1f2937;
            background: #0a0f15;
            margin-bottom: 8px;
        }
        .event-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
        .event-dot.trip { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,.5); }
        .event-dot.cold { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.4); }
        .event-dot.info { background: #3b82f6; box-shadow: 0 0 8px rgba(59,130,246,.45); }
        .event-main .event-title { color: #f3f4f6; font-weight: 700; font-size: 13px; }
        .event-main .event-sub { color: #9ca3af; font-size: 12px; margin-top: 2px; }
        .event-time { color: #6b7280; font-size: 11px; letter-spacing: 1px; }
        .event-empty { color: #6b7280; text-align: center; padding: 24px; }
        .admin-recent-events {
            margin-top: 16px;
            background: linear-gradient(180deg, rgba(11, 15, 21, 0.95), rgba(8, 11, 16, 0.95));
            border: 1px solid #1f2937;
            border-radius: 16px;
            padding: 14px;
        }
        .admin-recent-events .recent-events-list { max-height: 240px; }
        .admin-user-header-actions { display: flex; align-items: center; gap: 10px; }
        .admin-send-message-btn {
            border: 1px solid rgba(59,130,246,.35);
            background: rgba(59,130,246,.12);
            color: #93c5fd;
            border-radius: 10px;
            padding: 8px 12px;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: .7px;
            text-transform: uppercase;
            cursor: pointer;
        }
        .admin-send-message-btn:hover {
            background: rgba(59,130,246,.2);
            border-color: rgba(59,130,246,.55);
        }
        .app-footer {
            border-top: 1px solid #111827;
            background: #06080d;
            color: #64748b;
        }
        @media (max-width: 1180px) {
            .main-content { grid-template-columns: 1fr; }
            .search-section { grid-column: 1; grid-row: auto; position: static; }
            .alerts-section,
            #allDevicesSection,
            #deviceSection,
            #searchMsg,
            #recentEventsSection { grid-column: 1; }
            .device-chips { max-height: 240px; }
        }

        @media (max-width: 900px) {
            #mainPage { overflow-x: hidden; }
            .topbar { padding: 10px 12px; }
            .main-content {
                width: 100%;
                margin: 12px 0 18px;
                padding: 0 8px;
                grid-template-columns: 1fr;
                gap: 14px;
            }
            .search-section { grid-column: 1; grid-row: auto; position: static; top: auto; }
            .alerts-section,
            #allDevicesSection,
            #deviceSection,
            #searchMsg,
            #recentEventsSection { grid-column: 1; width: 100%; }
            .device-card {
                padding: 18px 14px;
                overflow: hidden;
            }
            .gauge-container { width: min(100%, 320px); height: 200px; }

            .admin-mobile-menu-btn { display: inline-flex; }
            .admin-topbar {
                padding: 10px 10px;
                gap: 10px;
            }
            .admin-topbar-brand {
                min-width: 0;
                gap: 10px;
                flex: 1;
            }
            .admin-topbar-brand .admin-logo { height: 34px; }
            .admin-topbar-brand h1 {
                font-size: 15px;
                white-space: nowrap;
            }
            .admin-topbar-right { gap: 8px; }
            .admin-user-trigger {
                padding: 6px 10px;
                max-width: 44vw;
            }
            #adminFullname {
                display: inline-block;
                max-width: 28vw;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
            .admin-stats-row {
                grid-template-columns: 1fr;
                padding: 12px 10px;
                gap: 12px;
            }
            .admin-body {
                position: relative;
                min-height: calc(100vh - 210px);
            }
            .admin-main {
                width: 100%;
                min-width: 0;
                overflow-x: hidden;
                padding: 14px 10px;
            }
            .admin-devices-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }
            .admin-mini-card { padding: 14px; }
            .admin-mini-card .amc-header {
                flex-wrap: wrap;
                gap: 8px;
            }
            .admin-mini-card .amc-gauge-row {
                gap: 10px;
                align-items: flex-start;
            }
            .admin-mini-card .amc-gauge-data {
                min-width: 0;
                width: 100%;
            }
            .admin-mini-card canvas {
                max-width: 100%;
                height: auto;
            }

            .admin-sidebar {
                position: fixed;
                top: 0;
                left: 0;
                height: 100dvh;
                max-height: none;
                width: min(86vw, 340px);
                min-width: min(86vw, 340px);
                max-width: min(86vw, 340px);
                border-right: 1px solid #251515;
                border-bottom: none;
                background: linear-gradient(180deg, rgba(8, 8, 8, 0.98), rgba(4, 4, 4, 0.98));
                backdrop-filter: blur(12px);
                box-shadow: 20px 0 40px rgba(0,0,0,.58);
                transform: translateX(-104%);
                transition: transform .24s ease;
                z-index: 330;
            }
            .admin-sidebar-resizer { display: none; }
            #adminPage.mobile-sidebar-open .admin-mobile-sidebar-backdrop { display: block; }
            #adminPage.mobile-sidebar-open .admin-sidebar { transform: translateX(0); }

            .admin-sidebar-header-top {
                flex-wrap: wrap;
                align-items: center;
            }
            .admin-sidebar-header {
                padding: 14px 12px 12px;
                border-bottom: 1px solid #251515;
                background: linear-gradient(180deg, rgba(12, 12, 12, 0.98), rgba(8, 8, 8, 0.98));
                position: sticky;
                top: 0;
                z-index: 2;
            }
            .admin-sidebar-header h3 { margin-bottom: 0; }
            .admin-sidebar-close-btn { display: inline-block; }
            .admin-broadcast-btn {
                width: 100%;
                text-align: center;
                padding: 8px 10px;
                margin-top: 4px;
            }
            .user-total {
                margin-top: 6px;
            }
            .admin-sidebar-header h3 {
                color: #f8fafc;
            }
            .admin-user-list { padding: 10px 10px 16px; }
            .admin-user-item {
                flex-wrap: wrap;
                gap: 8px;
                align-items: flex-start;
                background: rgba(10, 10, 10, 0.9);
                border: 1px solid #251515;
            }
            .admin-user-item .aui-badges {
                width: 100%;
                justify-content: flex-start;
            }
        }

        @media (max-width: 550px) {
            .main-content { padding: 0 6px; }
            .device-card { padding: 16px 12px; }
            .gauge-container { width: min(100%, 300px); height: 188px; }

            .admin-main { padding: 12px 8px; }
            .admin-topbar { padding: 8px; }
            #adminFullname { max-width: 24vw; }
            .admin-mini-card .amc-temp { font-size: 30px; }
            .admin-mini-card .amc-mchd-metrics { grid-template-columns: 1fr; }
        }
    
