/* ===== G-Monitoring Brand Colors ===== */
:root {
    --gm-orange:       #f07000;
    --gm-orange-light: #ff8c00;
    --gm-dark:         #1a1a1a;
    --gm-dark2:        #242424;
    --gm-silver:       #8a9099;
    --gm-bg:           #f0f2f5;
    --gm-card-border:  rgba(240, 112, 0, 0.15);
}

/* ===== Base ===== */
body {
    background-color: var(--gm-bg);
    font-size: 0.9rem;
    color: #1a1a1a;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--gm-dark) !important;
    border-bottom: 2px solid var(--gm-orange);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.navbar-brand {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.navbar-brand img {
    filter: drop-shadow(0 0 4px rgba(240,112,0,0.5));
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    transition: color 0.15s;
    border-radius: 5px;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--gm-orange-light) !important;
    background: rgba(255,255,255,0.05);
}

.navbar-dark .navbar-nav .nav-link.active {
    color: var(--gm-orange-light) !important;
    background: rgba(240,112,0,0.12);
}

/* ===== Buttons ===== */
.btn-primary {
    background-color: var(--gm-orange);
    border-color: var(--gm-orange);
    color: #fff;
    font-weight: 500;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--gm-orange-light);
    border-color: var(--gm-orange-light);
    color: #fff;
    box-shadow: 0 2px 8px rgba(240,112,0,0.35);
}
.btn-outline-primary {
    color: var(--gm-orange);
    border-color: var(--gm-orange);
}
.btn-outline-primary:hover {
    background-color: var(--gm-orange);
    border-color: var(--gm-orange);
    color: #fff;
}
.btn-outline-secondary {
    border-color: #d0d5dd;
}
.btn {
    transition: all 0.15s ease;
}

/* ===== Cards ===== */
.card {
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 1px 8px rgba(0,0,0,0.07);
    transition: box-shadow 0.15s;
}
.card:hover {
    box-shadow: 0 3px 16px rgba(0,0,0,0.11);
}
.card-header {
    border-bottom: 1px solid var(--gm-card-border);
    background: rgba(240,112,0,0.04);
    border-radius: 10px 10px 0 0 !important;
}

/* ===== Tables ===== */
.table {
    --bs-table-hover-bg: rgba(240, 112, 0, 0.04);
}
.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gm-silver);
    white-space: nowrap;
    border-bottom: 2px solid #e9ecef;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}
.table td {
    vertical-align: middle;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #f0f2f5;
}
.table tbody tr {
    transition: background 0.1s;
}
.table tbody tr:hover {
    background-color: rgba(240, 112, 0, 0.04) !important;
}
.table-light th, thead.table-light th {
    background: #f7f7f8;
}

/* ===== Badges ===== */
.badge.bg-primary {
    background-color: var(--gm-orange) !important;
}
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ===== Stat cards on dashboard ===== */
.stat-card {
    border-left: 4px solid var(--gm-orange);
    background: #fff;
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    box-shadow: 0 1px 8px rgba(0,0,0,0.07);
    transition: box-shadow 0.15s, transform 0.15s;
    height: 100%;
}
.stat-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.11);
    transform: translateY(-1px);
}
.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gm-orange);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--gm-silver);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-card.danger {
    border-left-color: #dc3545;
}
.stat-card.danger .stat-value {
    color: #dc3545;
}
.stat-card.warning {
    border-left-color: #fd7e14;
}
.stat-card.warning .stat-value {
    color: #fd7e14;
}
.stat-card.success {
    border-left-color: #198754;
}
.stat-card.success .stat-value {
    color: #198754;
}

/* ===== Page titles ===== */
h4 {
    font-weight: 700;
    color: var(--gm-dark);
}
h5 {
    font-weight: 600;
}

/* ===== Page header bar ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* ===== Form controls ===== */
.form-control:focus, .form-select:focus {
    border-color: var(--gm-orange);
    box-shadow: 0 0 0 0.2rem rgba(240,112,0,0.18);
}
.form-label.fw-semibold {
    font-size: 0.85rem;
    color: #495057;
}
.form-text {
    font-size: 0.78rem;
}

/* ===== Search/filter bar ===== */
.filter-bar {
    background: #fff;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.06);
}

/* ===== Action buttons in tables ===== */
.btn-action {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.15s;
}

/* ===== Accordion (warehouse report) ===== */
.accordion-button:not(.collapsed) {
    background-color: rgba(240,112,0,0.07);
    color: var(--gm-dark);
    box-shadow: inset 0 -1px 0 var(--gm-card-border);
}
.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(240,112,0,0.25);
}

/* ===== Login page ===== */
.login-bg {
    background: linear-gradient(135deg, #111 0%, #1c1c1c 50%, #111 100%);
    min-height: 100vh;
}
.login-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-top: 3px solid var(--gm-orange);
    border-radius: 14px;
    color: #e0e0e0;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.login-card .form-control {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
    border-radius: 8px;
}
.login-card .form-control:focus {
    background: #2a2a2a;
    border-color: var(--gm-orange);
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(240,112,0,0.25);
}
.login-card .form-control::placeholder {
    color: #666;
}
.login-card .input-group-text {
    background: #333;
    border-color: #444;
    color: #aaa;
    border-radius: 8px 0 0 8px;
}
.login-card label {
    color: #aaa;
    font-size: 0.85rem;
}
.login-card .btn-primary {
    border-radius: 8px;
    padding: 0.6rem;
    font-size: 1rem;
}

/* ===== Alert improvements ===== */
.alert {
    border-radius: 10px;
    border-left-width: 4px;
}

/* ===== Notification list ===== */
.notification-item {
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

/* ===== Scrollable table wrapper ===== */
.table-responsive {
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 8px rgba(0,0,0,0.07);
    border: 1px solid rgba(0,0,0,0.06);
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 0.95rem; }
    .table-responsive { font-size: 0.8rem; }
    .stat-card .stat-value { font-size: 1.7rem; }
    .stat-card { padding: 0.8rem 1rem; }

    /* Отступ снизу чтобы PWA-кнопка не перекрывала контент */
    main.container-fluid {
        padding-bottom: 100px;
    }
    /* Кнопки в формах тоже не должны перекрываться */
    form .btn[type="submit"]:last-of-type {
        margin-bottom: 0;
    }

    /* Индикатор горизонтального скролла в таблицах */
    .table-responsive {
        position: relative;
    }
    .table-responsive::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 32px;
        background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
        pointer-events: none;
        border-radius: 0 10px 10px 0;
    }
}

/* ===== Print ===== */
@media print {
    .navbar, .no-print, #pwa-install { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; }
    .btn { display: none !important; }
    a { color: #000 !important; text-decoration: none !important; }
    .badge { border: 1px solid #999 !important; }
    main.container-fluid { padding: 0 !important; }
}

/* ===== PWA install button ===== */
#pwa-install {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    padding: 10px 20px;
    box-shadow: 0 4px 20px rgba(240,112,0,0.4);
    border-radius: 50px;
    background: var(--gm-orange);
    border: none;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
#pwa-install:hover {
    background: var(--gm-orange-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(240,112,0,0.5);
}
@media (max-width: 768px) {
    #pwa-install {
        bottom: 16px;
        right: 16px;
        padding: 10px 12px;
        font-size: 0.78rem;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    #pwa-install .pwa-label {
        display: none;
    }
    #pwa-install .pwa-icon {
        margin: 0;
        font-size: 1.2rem;
    }
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gm-silver);
}
.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}
