/* e:/WEB/Harlis/assets/style.css */

:root {
    --primary-color: #4046A2;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --danger-color: #FF3B30;
    --warning-color: #FF9500;
    --background-color: #F2F2F7;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-radius: 16px;
    --glass-blur: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --background-color: #1C1C1E;
    --card-bg: rgba(44, 44, 46, 0.8);
    --text-primary: #FFFFFF;
    --text-secondary: #98989D;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    padding-bottom: 80px;
    transition: background-color 0.3s, color 0.3s;
}

/* Auth */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.auth-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow);
    text-align: center;
    backdrop-filter: blur(var(--glass-blur));
}

.auth-card h1 {
    margin-bottom: 10px;
}

.auth-card p {
    margin-bottom: 30px;
    color: var(--text-secondary);
}

/* Header */
.header {
    background: var(--primary-color);
    color: white;
    padding: 20px 20px 20px 20px;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    /*box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);*/
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.title {
    font-size: 1.4em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.header-icon {
    font-size: 24px;
    cursor: pointer;
    color: white;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
    margin-top: -30px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s;
    position: relative;
    /* For absolute positioned icon */
}

.card>* {
    pointer-events: none;
}

.card:active {
    transform: scale(0.98);
}

.card-action-btn {
    pointer-events: auto !important;
    /* Ensure button is clickable */
    background: rgba(128, 128, 128, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 20px;
    margin-left: 10px;
    transition: background 0.2s;
}

.card-action-btn:active {
    background: rgba(128, 128, 128, 0.3);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.card-info {
    flex: 1;
    margin-left: 16px;
}

.card-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.card-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Inventory Table */
.table-container {
    overflow-x: auto;
    padding: 0 20px 20px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 0px;
    /* Remove margin as it will be in scroll container */
}

/* New Layout for Inventory View */
#view-items {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    /* Adjust based on header/nav */
    overflow: hidden;
}

.table-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

.summary-footer {
    padding: 10px 20px 20px 20px;
    background: var(--background-color);
    border-top: 1px solid rgba(128, 128, 128, 0.1);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

th,
td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

th {
    background: rgba(128, 128, 128, 0.1);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

/* Summary Table Specifics */
.summary-table th {
    text-align: left;
}

.summary-table td {
    text-align: left;
}

.summary-table td:last-child {
    text-align: right;
    font-weight: bold;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: var(--text-secondary);
}

.status-OK {
    background: var(--success-color);
}

.status-Defeito {
    background: var(--danger-color);
}

.status-Bloqueado {
    background: #000;
}

.status-Manutenção {
    background: var(--warning-color);
}

.status-Bloqueado-com-conta {
    background: #555;
}

.status-Devolução {
    background: var(--secondary-color);
}

.status-Em-conserto {
    background: var(--warning-color);
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-right: 5px;
    vertical-align: middle;
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.color-option.selected {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid rgba(128, 128, 128, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 12px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 10px;
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    cursor: pointer;
    z-index: 99;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(40px);
    width: 90%;
    max-width: 400px;
    padding: 24px;
    border-radius: 24px;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(128, 128, 128, 0.2);
    background: var(--background-color);
    font-size: 16px;
    color: var(--text-primary);
}

option {
    background-color: var(--background-color);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

/* Settings List */
.settings-list {
    padding: 20px;
}

.settings-group {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.settings-item {
    padding: 16px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-item:last-child {
    border-bottom: none;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.user-row span {
    font-weight: 500;
}

.badge-role {
    font-size: 10px;
    background: #ccc;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    color: #333;
}