@import 'variables.css';
@import 'reset.css';
@import 'sidebar.css';
@import 'header.css';
@import 'cards.css';
@import 'forms.css';
@import 'tables.css';
@import 'modal.css';
@import 'animations.css';

.app {
  min-height: 100vh;
  display: flex;
}

.main {
  flex: 1;
  min-width: 0;
}

.content {
  max-width: 1280px;
  padding: 30px;
  margin: auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.heading h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.heading p {
  color: var(--muted);
  margin: 0;
}

.btn {
  border: 1px solid var(--line);
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  padding: 9px 13px;
  border-radius: 6px;
  font-weight: 600;
}

    .btn.primary {
        background: #3e63d8;
        border-color: #3e63d8;
        color: white;
    }

.btn:hover {
  filter: brightness(.97);
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

.two {
  grid-template-columns: 1.4fr 1fr;
  margin-bottom: 18px;
}

.good {
  color: var(--brand);
}

.warning {
  color: var(--amber);
}

.danger {
  color: var(--red);
}

.muted {
  color: var(--muted);
}

.alert {
  display: flex;
  justify-content: space-between;
  padding: 13px;
  border-radius: 7px;
  background: var(--amber-soft);
  color: #6e4500;
  margin-bottom: 10px;
}

.alert small {
  color: #876922;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.list li:last-child {
  border: 0;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 11px;
  white-space: nowrap;
}

.badge.good {
  background: var(--brand-soft);
  color: #16634e;
}

.badge.warn {
  background: var(--amber-soft);
  color: #8b5300;
}

.badge.danger {
  background: var(--red-soft);
  color: #963234;
}

.badge.info {
  background: var(--blue-soft);
  color: var(--blue);
}

.bar {
  height: 8px;
  border-radius: 9px;
  background: #e7eeeb;
  overflow: hidden;
}

    .bar i {
        display: block;
        height: 100%;
        background: #3e63d8;
    }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.report {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.report:last-child {
  border-bottom: 0;
}

.plan {
    background: #de5d27;
    color: white;
}

.plan .muted {
  color: #a9c9c2;
}

.plan .price {
  font-size: 25px;
  font-weight: 700;
  margin: 6px 0;
}

.invoice a {
    color: #de5d27;
    font-weight: 600;
    text-decoration: none;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* License Statistics */
.license-stats {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 18px;
}

    .license-stats .card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

        .license-stats .card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        }

/* Device Status Cards */
.device-status {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 24px;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

    .status-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

.status-icon {
    font-size: 28px;
    line-height: 1;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
}

.status-info {
    flex: 1;
}

.status-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-count {
    font-size: 24px;
    font-weight: 700;
    margin: 2px 0;
}

.status-percent {
    font-size: 12px;
    color: var(--muted);
}

/* Status Card Colors */
.status-card.protected .status-count {
    color: var(--brand);
}

.status-card.protected .status-icon {
    background: var(--brand-soft);
}

.status-card.update-due .status-count {
    color: var(--amber);
}

.status-card.update-due .status-icon {
    background: var(--amber-soft);
}

.status-card.offline .status-count {
    color: var(--red);
}

.status-card.offline .status-icon {
    background: var(--red-soft);
}

/* Responsive for license stats */
@media (max-width: 850px) {
    .license-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .device-status {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 540px) {
    .license-stats {
        grid-template-columns: 1fr;
    }

    .device-status {
        grid-template-columns: 1fr;
    }

    .status-card {
        padding: 14px 16px;
    }
}

/* Ticket Statistics */
.ticket-stats {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 18px;
}

/* Ticket Filters */
.ticket-filters {
    margin-bottom: 18px;
    padding: 16px 20px;
}

    .ticket-filters .filter-row {
        display: flex;
        gap: 16px;
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .ticket-filters .filter-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 150px;
    }

        .ticket-filters .filter-item label {
            font-size: 12px;
            color: var(--muted);
            font-weight: 500;
        }

        .ticket-filters .filter-item select,
        .ticket-filters .filter-item input {
            padding: 8px 12px;
            border: 1.5px solid var(--line);
            border-radius: 6px;
            font: inherit;
            font-size: 13px;
            background: white;
            color: var(--ink);
        }

            .ticket-filters .filter-item select:focus,
            .ticket-filters .filter-item input:focus {
                outline: none;
                border-color: #3e63d8;
                box-shadow: 0 0 0 3px rgba(62, 99, 216, 0.1);
            }

    .ticket-filters .filter-search {
        flex: 1;
        min-width: 200px;
    }

    .ticket-filters .filter-actions {
        display: flex;
        gap: 8px;
        align-items: center;
    }

/* Ticket Table */
.ticket-table-container {
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

    .table-header h2 {
        font-size: 16px;
        margin: 0;
    }

.ticket-count {
    font-size: 13px;
    color: var(--muted);
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
}

    .ticket-table th {
        background: #f8faf9;
        padding: 12px 15px;
        text-align: left;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted);
        font-weight: 600;
    }

    .ticket-table td {
        padding: 12px 15px;
        border-bottom: 1px solid var(--line);
        vertical-align: middle;
    }

    .ticket-table tr:hover td {
        background: #fafbfb;
    }

    .ticket-table tr:last-child td {
        border-bottom: 0;
    }

.ticket-id {
    font-weight: 600;
    color: #3e63d8;
    font-size: 13px;
}

.ticket-subject {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ticket-user {
    font-size: 12px;
    color: var(--muted);
}

.ticket-date {
    font-size: 13px;
    color: var(--muted);
}

/* Ticket Actions */
.ticket-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.btn.small {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
}

.btn.good {
    background: var(--brand-soft);
    border-color: var(--brand-soft);
    color: #16634e;
}

    .btn.good:hover {
        background: var(--brand);
        color: white;
    }

.btn.danger {
    background: var(--red-soft);
    border-color: var(--red-soft);
    color: #963234;
}

    .btn.danger:hover {
        background: var(--red);
        color: white;
    }

/* Severity Badges */
.badge.severity-critical {
    background: var(--red-soft);
    color: #963234;
}

.badge.severity-high {
    background: var(--amber-soft);
    color: #8b5300;
}

.badge.severity-medium {
    background: var(--blue-soft);
    color: var(--blue);
}

.badge.severity-low {
    background: var(--brand-soft);
    color: #16634e;
}

/* Status Badges */
.badge.status-open {
    background: var(--amber-soft);
    color: #8b5300;
}

.badge.status-progress {
    background: var(--blue-soft);
    color: var(--blue);
}

.badge.status-resolved {
    background: var(--brand-soft);
    color: #16634e;
}

.badge.status-closed {
    background: var(--line);
    color: var(--muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px !important;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-weight: 600;
    font-size: 16px;
    margin: 0 0 4px;
}

/* Table Footer */
.table-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
}

/* Ticket Detail Modal */
.ticket-detail {
    padding: 8px 0;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

    .detail-row:last-child {
        border-bottom: 0;
    }

.detail-label {
    font-weight: 600;
    min-width: 100px;
    color: var(--muted);
}

.detail-value {
    flex: 1;
}

/* Notification */
.notification {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 850px) {
    .ticket-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ticket-filters .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ticket-filters .filter-item {
        min-width: 100%;
    }

    .ticket-filters .filter-search {
        min-width: 100%;
    }

    .ticket-table {
        font-size: 12px;
    }

        .ticket-table th,
        .ticket-table td {
            padding: 8px 10px;
        }

    .ticket-actions {
        flex-wrap: wrap;
    }

    .btn.small {
        font-size: 10px;
        padding: 3px 8px;
    }
}

@media (max-width: 540px) {
    .ticket-stats {
        grid-template-columns: 1fr;
    }

    .ticket-table {
        font-size: 11px;
    }

        .ticket-table th,
        .ticket-table td {
            padding: 6px 8px;
        }

    .ticket-actions .btn {
        font-size: 9px;
        padding: 2px 6px;
    }
}