/* === RESET & BASE === */
        * { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --apple-blue: #0071e3;
            --apple-blue-hover: #0077ed;
            --apple-text: #1d1d1f;
            --apple-text-secondary: #86868b;
            --apple-bg: #f5f5f7;
            --apple-card-bg: #ffffff;
            --apple-green: #34c759;
            --apple-red: #ff3b30;
            --apple-border: rgba(0, 0, 0, 0.08);
            --apple-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
            --apple-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
            --apple-radius: 18px;
            --apple-radius-small: 12px;
            --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
            --header-height: 52px;
        }

        html { scroll-behavior: smooth; }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
            background: var(--apple-bg);
            color: var(--apple-text);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            line-height: 1.47;
            font-size: 17px;
        }

        /* ============================================ */
        /* ШАПКА В СТИЛЕ APPLE                          */
        /* ============================================ */
        .apple-header {
            position: sticky;
            top: 0;
            z-index: 1000;
            background: rgba(255, 255, 255, 0.72);
            backdrop-filter: saturate(180%) blur(20px);
            -webkit-backdrop-filter: saturate(180%) blur(20px);
            border-bottom: 1px solid var(--apple-border);
        }

        .apple-header-inner {
            max-width: 980px;
            margin: 0 auto;
            padding: 0 20px;
            height: var(--header-height);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        /* Логотип */
        .apple-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 19px;
            font-weight: 700;
            color: var(--apple-text);
            text-decoration: none;
            letter-spacing: -0.4px;
            transition: var(--transition);
        }

        .apple-logo:hover { opacity: 0.7; }

        .apple-logo-icon {
            width: 30px;
            height: 30px;
            background: linear-gradient(135deg, #0071e3 0%, #00c6ff 100%);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 16px;
        }

        /* Desktop навигация */
        .apple-nav {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .apple-nav-link {
            padding: 8px 16px;
            color: var(--apple-text);
            text-decoration: none;
            border-radius: 980px;
            font-size: 15px;
            font-weight: 500;
            transition: var(--transition);
        }

        .apple-nav-link:hover {
            background: rgba(0, 0, 0, 0.05);
        }

        .apple-nav-link.active {
            background: rgba(0, 113, 227, 0.1);
            color: var(--apple-blue);
        }

        /* Правая часть шапки */
        .apple-header-actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* Кнопка Добавить (синяя, как у Apple) */
        .apple-btn-add {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 18px;
            background: var(--apple-blue);
            color: white;
            border: none;
            border-radius: 980px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            text-decoration: none;
            transition: var(--transition);
            font-family: inherit;
        }

        .apple-btn-add:hover {
            background: var(--apple-blue-hover);
            transform: scale(1.03);
        }

        /* Кнопка Админка (серая) */
        .apple-btn-admin {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            background: rgba(0, 0, 0, 0.05);
            color: var(--apple-text);
            border: none;
            border-radius: 50%;
            font-size: 16px;
            cursor: pointer;
            text-decoration: none;
            transition: var(--transition);
        }

        .apple-btn-admin:hover {
            background: rgba(0, 0, 0, 0.1);
            transform: rotate(45deg);
        }

        /* Бургер-меню */
        .apple-burger {
            display: none;
            width: 40px;
            height: 40px;
            border: none;
            background: transparent;
            cursor: pointer;
            position: relative;
        }

        .apple-burger-line {
            display: block;
            width: 22px;
            height: 2px;
            background: var(--apple-text);
            border-radius: 2px;
            transition: var(--transition);
            position: absolute;
            left: 9px;
        }

        .apple-burger-line:nth-child(1) { top: 12px; }
        .apple-burger-line:nth-child(2) { top: 19px; }
        .apple-burger-line:nth-child(3) { top: 26px; }

        .apple-burger.active .apple-burger-line:nth-child(1) {
            top: 19px;
            transform: rotate(45deg);
        }
        .apple-burger.active .apple-burger-line:nth-child(2) {
            opacity: 0;
            transform: translateX(-10px);
        }
        .apple-burger.active .apple-burger-line:nth-child(3) {
            top: 19px;
            transform: rotate(-45deg);
        }

        /* Выпадающее меню */
        .apple-dropdown {
            position: fixed;
            top: var(--header-height);
            left: 0;
            right: 0;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: saturate(180%) blur(20px);
            -webkit-backdrop-filter: saturate(180%) blur(20px);
            border-bottom: 1px solid var(--apple-border);
            padding: 12px 20px 16px;
            transform: translateY(-10px);
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            z-index: 999;
        }

        .apple-dropdown.active {
            transform: translateY(0);
            opacity: 1;
            visibility: visible;
        }

        .apple-dropdown-inner {
            max-width: 980px;
            margin: 0 auto;
        }

        .apple-dropdown-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 16px;
            color: var(--apple-text);
            text-decoration: none;
            border-radius: var(--apple-radius-small);
            font-size: 17px;
            font-weight: 500;
            transition: var(--transition);
            position: relative;
            z-index: 1002;
            cursor: pointer;
            -webkit-tap-highlight-color: rgba(0, 113, 227, 0.15);
        }

        .apple-dropdown-item:hover {
            background: rgba(0, 113, 227, 0.08);
        }

        .apple-dropdown-icon {
            width: 38px;
            height: 38px;
            background: rgba(0, 113, 227, 0.1);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }

        /* ============================================ */
        /* МОБИЛЬНАЯ ВЕРСИЯ                             */
        /* ============================================ */
        @media (max-width: 768px) {
            .apple-nav { display: none; }
            .apple-burger { display: block; }

            .apple-btn-add {
                padding: 8px 14px;
            }

            .apple-btn-add .btn-text { display: none; }

            .container { padding: 20px 16px; }

            h1 { font-size: 32px; }
        }

        /* ============================================ */
        /* ОСНОВНОЙ КОНТЕНТ                             */
        /* ============================================ */
        .container {
            max-width: 980px;
            margin: 0 auto;
            padding: 32px 20px 60px;
        }

        h1 {
            font-size: 40px;
            font-weight: 700;
            letter-spacing: -0.6px;
            line-height: 1.1;
            margin-bottom: 24px;
        }

        h2 {
            font-size: 24px;
            font-weight: 700;
            letter-spacing: -0.3px;
            margin-bottom: 16px;
        }

        a { color: var(--apple-blue); text-decoration: none; }
        a:hover { text-decoration: none; }

        /* Карточка в стиле Apple */
        .card {
            background: var(--apple-card-bg);
            border-radius: var(--apple-radius);
            padding: 20px;
            margin-bottom: 16px;
            box-shadow: var(--apple-shadow);
            transition: var(--transition);
        }

        .card:hover {
            transform: translateY(-2px);
            box-shadow: var(--apple-shadow-hover);
        }

        .muted {
            color: var(--apple-text-secondary);
            font-size: 15px;
        }

        .title {
            font-weight: 600;
            font-size: 17px;
            margin-bottom: 4px;
        }

        .item {
            display: block;
            color: inherit;
            text-decoration: none;
        }

        .quantity {
            font-size: 22px;
            font-weight: 700;
            margin-top: 8px;
        }

        .big {
            font-size: 44px;
            font-weight: 800;
            letter-spacing: -1px;
            margin: 8px 0;
        }

        .label {
            color: var(--apple-text-secondary);
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            font-weight: 600;
            margin-bottom: 8px;
        }

        /* Кнопки в стиле Apple */
        .btn {
            width: 100%;
            border: 0;
            border-radius: 12px;
            padding: 14px 12px;
            font-size: 17px;
            font-weight: 600;
            background: rgba(0, 0, 0, 0.05);
            color: var(--apple-text);
            cursor: pointer;
            font-family: inherit;
            transition: var(--transition);
        }

        .btn:hover { background: rgba(0, 0, 0, 0.1); }

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

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

        .btn.small {
            width: auto;
            display: inline-block;
            padding: 10px 20px;
            font-size: 15px;
        }

        /* Формы */
        .form-field { margin-bottom: 14px; }

        input, select, textarea, button { font: inherit; }

        input, select, textarea {
            width: 100%;
            padding: 14px 16px;
            border: 1px solid rgba(0, 0, 0, 0.1);
            border-radius: var(--apple-radius-small);
            box-sizing: border-box;
            background: var(--apple-card-bg);
            font-size: 17px;
            transition: var(--transition);
        }

        input:focus, select:focus, textarea:focus {
            outline: none;
            border-color: var(--apple-blue);
            box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
        }

        textarea { min-height: 90px; resize: vertical; }

        /* Сообщения */
        .messages { margin-bottom: 20px; }

        .message {
            padding: 14px 18px;
            border-radius: var(--apple-radius-small);
            margin-bottom: 10px;
            font-weight: 500;
        }

        .message.success { background: #d1f7dd; color: #0f7132; }
        .message.error { background: #ffd6d6; color: #a30711; }
        .message.info { background: #d6e8ff; color: #0040a0; }

        /* История */
        .history-item {
            padding: 12px 0;
            border-bottom: 1px solid var(--apple-border);
        }

        .history-item:last-child { border-bottom: 0; }

        /* QR блок */
        .qr img {
            border-radius: var(--apple-radius-small);
            background: white;
        }

        /* Сетка кнопок */
        .button-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }
    
    /* ============================================ */
    /* КНОПКА ВЫХОДА                                 */
    /* ============================================ */
    .apple-btn-logout {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.05);
        color: var(--apple-text-secondary);
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

    .apple-btn-logout:hover {
        background: rgba(255, 59, 48, 0.12);
        color: var(--apple-red);
    }

    .apple-btn-logout svg {
        display: block;
    }
