﻿:root {
    --phone-primary: #17375e;
    --phone-primary-hover: #102b4d;
    --phone-primary-soft: #eaf1f9;
    --phone-primary-border: #cbd9e9;
    --phone-page: #f3f6fa;
    --phone-surface: #ffffff;
    --phone-surface-soft: #f8fafc;
    --phone-border: #e2e8f0;
    --phone-text: #162033;
    --phone-text-soft: #64748b;
    --phone-text-light: #94a3b8;
    --phone-success: #15803d;
    --phone-success-soft: #dcfce7;
    --phone-info: #1d4ed8;
    --phone-info-soft: #dbeafe;
    --phone-warning: #b45309;
    --phone-warning-soft: #fef3c7;
    --phone-danger: #b91c1c;
    --phone-danger-soft: #fee2e2;
    --phone-neutral: #475569;
    --phone-neutral-soft: #e2e8f0;
    --phone-radius-sm: 12px;
    --phone-radius-md: 18px;
    --phone-radius-lg: 26px;
    --phone-shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
}

body.dark {
    --phone-primary: #7aa7dc;
    --phone-primary-hover: #98bce5;
    --phone-primary-soft: rgba(73, 116, 168, 0.2);
    --phone-primary-border: rgba(122, 167, 220, 0.25);
    --phone-page: #0b1320;
    --phone-surface: #111c2c;
    --phone-surface-soft: #172337;
    --phone-border: #26364d;
    --phone-text: #edf4fc;
    --phone-text-soft: #a5b5ca;
    --phone-text-light: #718299;
    --phone-success-soft: rgba(21, 128, 61, 0.2);
    --phone-info-soft: rgba(29, 78, 216, 0.2);
    --phone-warning-soft: rgba(180, 83, 9, 0.2);
    --phone-danger-soft: rgba(185, 28, 28, 0.2);
    --phone-neutral-soft: rgba(71, 85, 105, 0.25);
    --phone-shadow: 0 16px 45px rgba(0, 0, 0, 0.24);
}

.phones-page,
.phone-form-page,
.phone-details-page {
    min-height: 100vh;
    padding: 30px;
    color: var(--phone-text);
    background: var(--phone-page);
}

.phones-header,
.phone-form-header,
.phone-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    max-width: 1450px;
    margin: 0 auto 26px;
}

    .phones-header h1,
    .phone-form-header h1,
    .phone-details-header h1 {
        margin: 4px 0 7px;
        font-size: clamp(28px, 4vw, 40px);
        font-weight: 800;
    }

    .phones-header p,
    .phone-form-header p,
    .phone-details-header p {
        margin: 0;
        color: var(--phone-text-soft);
    }

.page-eyebrow {
    color: var(--phone-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.phone-btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

    .phone-btn:hover:not(:disabled) {
        transform: translateY(-2px);
    }

    .phone-btn:disabled {
        cursor: not-allowed;
        opacity: 0.65;
    }

.phone-btn-primary {
    color: #ffffff;
    background: var(--phone-primary);
}

    .phone-btn-primary:hover:not(:disabled) {
        background: var(--phone-primary-hover);
    }

.phone-btn-light {
    color: var(--phone-text);
    border-color: var(--phone-border);
    background: var(--phone-surface);
}

.phone-btn-danger-light {
    color: var(--phone-danger);
    border-color: rgba(185, 28, 28, 0.18);
    background: var(--phone-danger-soft);
}

.phone-stats {
    max-width: 1450px;
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.phone-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--phone-border);
    border-radius: var(--phone-radius-md);
    background: var(--phone-surface);
    box-shadow: var(--phone-shadow);
}

.phone-stat-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--phone-primary);
    font-size: 22px;
    background: var(--phone-primary-soft);
}

    .phone-stat-icon.available {
        color: var(--phone-success);
        background: var(--phone-success-soft);
    }

    .phone-stat-icon.assigned {
        color: var(--phone-info);
        background: var(--phone-info-soft);
    }

    .phone-stat-icon.maintenance {
        color: var(--phone-warning);
        background: var(--phone-warning-soft);
    }

.phone-stat-card span {
    display: block;
    margin-bottom: 3px;
    color: var(--phone-text-soft);
    font-size: 13px;
    font-weight: 650;
}

.phone-stat-card strong {
    display: block;
    font-size: 28px;
    line-height: 1;
}

.phones-toolbar {
    max-width: 1450px;
    margin: 0 auto 22px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(160px, 210px) minmax(160px, 210px) auto;
    gap: 12px;
}

.phones-search {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    border: 1px solid var(--phone-border);
    border-radius: 14px;
    background: var(--phone-surface);
}

    .phones-search span {
        color: var(--phone-text-soft);
        font-size: 22px;
    }

    .phones-search input {
        width: 100%;
        min-height: 48px;
        padding: 0;
        color: var(--phone-text);
        border: none;
        outline: none;
        background: transparent;
    }

.phones-toolbar select {
    min-height: 48px;
    padding: 0 14px;
    color: var(--phone-text);
    border: 1px solid var(--phone-border);
    border-radius: 14px;
    outline: none;
    background: var(--phone-surface);
}

.phones-grid {
    max-width: 1450px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.phone-card {
    overflow: hidden;
    border: 1px solid var(--phone-border);
    border-radius: var(--phone-radius-lg);
    background: var(--phone-surface);
    box-shadow: var(--phone-shadow);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

    .phone-card:hover {
        transform: translateY(-4px);
        border-color: var(--phone-primary-border);
    }

.phone-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.phone-device-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--phone-primary);
    font-size: 27px;
    background: var(--phone-primary-soft);
}

.phone-status,
.phone-condition {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 29px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.status-available {
    color: var(--phone-success);
    background: var(--phone-success-soft);
}

.status-assigned {
    color: var(--phone-info);
    background: var(--phone-info-soft);
}

.status-maintenance {
    color: var(--phone-warning);
    background: var(--phone-warning-soft);
}

.status-lost {
    color: var(--phone-danger);
    background: var(--phone-danger-soft);
}

.status-inactive,
.status-default {
    color: var(--phone-neutral);
    background: var(--phone-neutral-soft);
}

.phone-card-content {
    padding: 19px 20px 20px;
}

.phone-brand {
    color: var(--phone-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.phone-card-content h2 {
    margin: 5px 0;
    font-size: 21px;
}

.phone-model {
    margin: 0;
    color: var(--phone-text-soft);
}

.phone-number {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 17px 0;
    padding: 12px 14px;
    border-radius: 13px;
    color: var(--phone-primary);
    font-weight: 750;
    background: var(--phone-primary-soft);
}

.phone-card-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

    .phone-card-details div {
        min-width: 0;
        padding: 12px;
        border: 1px solid var(--phone-border);
        border-radius: 13px;
        background: var(--phone-surface-soft);
    }

    .phone-card-details span,
    .phone-info-item span,
    .phone-summary-row span {
        display: block;
        margin-bottom: 4px;
        color: var(--phone-text-soft);
        font-size: 11px;
        font-weight: 700;
    }

    .phone-card-details strong {
        display: block;
        overflow: hidden;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.phone-card-footer {
    padding: 0 20px 20px;
}

.phone-details-btn {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    color: var(--phone-primary);
    border: 1px solid var(--phone-primary-border);
    border-radius: 13px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    background: var(--phone-primary-soft);
}

.phones-loading,
.phones-empty {
    max-width: 1450px;
    min-height: 330px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 35px;
    text-align: center;
    border: 1px dashed var(--phone-border);
    border-radius: var(--phone-radius-lg);
    background: var(--phone-surface);
}

    .phones-empty h1,
    .phones-empty h2 {
        margin: 0;
    }

    .phones-empty p {
        margin: 0 0 8px;
        color: var(--phone-text-soft);
    }

.phones-empty-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: var(--phone-primary);
    font-size: 32px;
    background: var(--phone-primary-soft);
}

.phones-spinner,
.button-spinner {
    border: 3px solid var(--phone-primary-border);
    border-top-color: var(--phone-primary);
    border-radius: 50%;
    animation: phoneSpin 0.8s linear infinite;
}

.phones-spinner {
    width: 36px;
    height: 36px;
}

.button-spinner {
    width: 17px;
    height: 17px;
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
}

@keyframes phoneSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Form */

.phone-form-layout,
.phone-details-layout {
    max-width: 1450px;
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: 20px;
}

.phone-form-main,
.phone-details-main {
    display: grid;
    gap: 18px;
}

.phone-form-card,
.phone-details-card,
.phone-preview-card,
.phone-form-actions,
.phone-quick-card {
    border: 1px solid var(--phone-border);
    border-radius: var(--phone-radius-lg);
    background: var(--phone-surface);
    box-shadow: var(--phone-shadow);
}

.phone-form-card,
.phone-details-card {
    padding: 24px;
}

.phone-section-heading,
.phone-details-card-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 22px;
}

    .phone-section-heading h2,
    .phone-details-card-heading h2 {
        margin: 0 0 3px;
        font-size: 18px;
    }

    .phone-section-heading p,
    .phone-details-card-heading p {
        margin: 0;
        color: var(--phone-text-soft);
        font-size: 13px;
    }

    .phone-section-icon,
    .phone-details-card-heading > span {
        width: 45px;
        height: 45px;
        flex: 0 0 45px;
        display: grid;
        place-items: center;
        border-radius: 14px;
        color: var(--phone-primary);
        background: var(--phone-primary-soft);
    }

.phone-fields-grid,
.phone-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.phone-field-full {
    grid-column: 1 / -1;
}

.phone-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 750;
}

    .phone-field label span {
        color: var(--phone-danger);
    }

.phone-input {
    width: 100%;
    min-height: 47px;
    padding: 11px 13px;
    color: var(--phone-text);
    border: 1px solid var(--phone-border);
    border-radius: 13px;
    outline: none;
    background: var(--phone-surface-soft);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .phone-input:focus {
        border-color: var(--phone-primary);
        box-shadow: 0 0 0 4px var(--phone-primary-soft);
    }

.phone-textarea {
    min-height: 115px;
    resize: vertical;
}

.phone-date-wrapper {
    width: 100%;
    min-height: 47px;
    display: flex;
    align-items: center;
    padding: 11px 13px;
    border: 1px solid var(--phone-border);
    border-radius: 13px;
    background: var(--phone-surface-soft);
}

    .phone-date-wrapper input {
        width: 100%;
        min-width: 0;
        padding: 0;
        color: var(--phone-text);
        border: none;
        outline: none;
        background: transparent;
    }

.validation-message {
    display: block;
    margin-top: 5px;
    color: var(--phone-danger);
    font-size: 12px;
}

.phone-form-sidebar,
.phone-details-sidebar {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 16px;
}

.phone-preview-card {
    padding: 25px;
    text-align: center;
}

.phone-preview-icon {
    width: 86px;
    height: 86px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 27px;
    color: var(--phone-primary);
    font-size: 42px;
    background: var(--phone-primary-soft);
}

.phone-preview-card h2 {
    margin: 15px 0 5px;
    font-size: 20px;
}

.phone-preview-card p {
    margin: 0;
    color: var(--phone-text-soft);
}

.phone-preview-number {
    margin-top: 17px;
    padding: 12px;
    border-radius: 13px;
    color: var(--phone-primary);
    font-weight: 800;
    background: var(--phone-primary-soft);
}

.phone-form-actions {
    display: grid;
    gap: 10px;
    padding: 17px;
}

    .phone-form-actions .phone-btn {
        width: 100%;
    }

.phone-back-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--phone-border);
    border-radius: 14px;
    color: var(--phone-text);
    font-size: 20px;
    cursor: pointer;
    background: var(--phone-surface);
}

.phone-form-header,
.phone-details-title {
    justify-content: flex-start;
}

.phone-details-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.phone-details-actions {
    display: flex;
    gap: 10px;
}

/* Details */

.phone-details-hero {
    max-width: 1450px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 25px;
    border: 1px solid var(--phone-primary-border);
    border-radius: var(--phone-radius-lg);
    background: var(--phone-primary-soft);
}

.phone-details-device {
    display: flex;
    align-items: center;
    gap: 17px;
}

.phone-details-device-icon {
    width: 75px;
    height: 75px;
    flex: 0 0 75px;
    display: grid;
    place-items: center;
    border-radius: 23px;
    color: var(--phone-primary);
    font-size: 36px;
    background: var(--phone-surface);
}

.phone-details-device h2 {
    margin: 9px 0 3px;
    font-size: 25px;
}

.phone-details-device p {
    margin: 0;
    color: var(--phone-text-soft);
}

.phone-details-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.phone-condition {
    color: var(--phone-neutral);
    background: var(--phone-neutral-soft);
}

.phone-hero-number {
    min-width: 220px;
    padding: 15px 18px;
    border-radius: 16px;
    text-align: right;
    background: var(--phone-surface);
}

    .phone-hero-number span {
        display: block;
        margin-bottom: 4px;
        color: var(--phone-text-soft);
        font-size: 12px;
    }

    .phone-hero-number strong {
        color: var(--phone-primary);
        font-size: 21px;
    }

.phone-info-item {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--phone-border);
    border-radius: 15px;
    background: var(--phone-surface-soft);
}

    .phone-info-item strong {
        display: block;
        overflow-wrap: anywhere;
        font-size: 14px;
    }

.phone-notes-box {
    min-height: 100px;
    padding: 17px;
    border: 1px solid var(--phone-border);
    border-radius: 15px;
    color: var(--phone-text-soft);
    line-height: 1.75;
    background: var(--phone-surface-soft);
}

.phone-quick-card {
    padding: 21px;
}

    .phone-quick-card h2 {
        margin: 0 0 16px;
        font-size: 17px;
    }

.phone-summary-row {
    padding: 13px 0;
    border-bottom: 1px solid var(--phone-border);
}

    .phone-summary-row:last-child {
        border-bottom: none;
    }

    .phone-summary-row strong {
        display: block;
        overflow-wrap: anywhere;
        font-size: 13px;
    }

@media (max-width: 1100px) {
    .phone-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .phones-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .phone-form-layout,
    .phone-details-layout {
        grid-template-columns: 1fr;
    }

    .phone-form-sidebar,
    .phone-details-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .phones-page,
    .phone-form-page,
    .phone-details-page {
        padding: 18px;
    }

    .phones-header,
    .phone-details-header {
        align-items: flex-start;
        flex-direction: column;
    }

        .phones-header .phone-btn,
        .phone-details-actions,
        .phone-details-actions .phone-btn {
            width: 100%;
        }

    .phones-toolbar {
        grid-template-columns: 1fr;
    }

    .phones-grid {
        grid-template-columns: 1fr;
    }

    .phone-fields-grid,
    .phone-info-grid {
        grid-template-columns: 1fr;
    }

    .phone-field-full {
        grid-column: auto;
    }

    .phone-form-sidebar,
    .phone-details-sidebar {
        grid-template-columns: 1fr;
    }

    .phone-details-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .phone-hero-number {
        min-width: 0;
        text-align: left;
    }
}

@media (max-width: 520px) {
    .phone-stats {
        grid-template-columns: 1fr;
    }

    .phone-card-details {
        grid-template-columns: 1fr;
    }

    .phone-form-card,
    .phone-details-card {
        padding: 18px;
    }

    .phone-details-device {
        align-items: flex-start;
    }

    .phone-details-device-icon {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
        font-size: 29px;
    }
}
