* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    direction: rtl;
}

/* Navbar */
.navbar {
    background: #075e54;
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.brand {
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-links a {
    color: #d4f1ee;
    text-decoration: none;
    margin-right: 16px;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: white;
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 900px;
    margin: 32px auto;
    padding: 0 16px;
}

.container h2 {
    margin-bottom: 20px;
    color: #075e54;
    font-size: 1.6rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h3 {
    margin-bottom: 16px;
    color: #128c7e;
    font-size: 1.1rem;
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 10px;
}

/* Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 360px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    text-align: center;
}

.login-box h2 {
    margin-bottom: 28px;
    color: #075e54;
    font-size: 1.5rem;
}

/* Form fields */
.field {
    margin-bottom: 16px;
    text-align: right;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

.field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.field input:focus {
    border-color: #075e54;
}

.field small {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Buttons */
.btn-primary {
    background: #075e54;
    color: white;
    border: none;
    padding: 11px 28px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #128c7e;
}

.btn-secondary {
    background: white;
    color: #075e54;
    border: 2px solid #075e54;
    padding: 9px 22px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #075e54;
    color: white;
}

.btn-danger {
    background: #e53935;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #c62828;
}

/* Status */
.status-card {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.status-card.connected {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.status-card.disconnected {
    background: #fce4ec;
    border: 1px solid #f48fb1;
    color: #c62828;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.connected .status-dot {
    background: #4caf50;
}

.disconnected .status-dot {
    background: #f44336;
}

/* QR Section */
.qr-section {
    background: white;
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.qr-section h3 {
    color: #075e54;
    margin-bottom: 8px;
}

.hint {
    color: #666;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.qr-box {
    margin: 16px auto;
    display: inline-block;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ccc;
    min-width: 220px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-box img {
    max-width: 250px;
    border-radius: 8px;
}

/* Connected box */
.connected-box {
    background: #e8f5e9;
    border-radius: 12px;
    padding: 24px;
    color: #2e7d32;
    font-size: 1.05rem;
    line-height: 1.8;
}

.connected-box a {
    color: #075e54;
    font-weight: bold;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table th {
    background: #075e54;
    color: white;
    padding: 12px 14px;
    text-align: right;
}

table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

table tr:hover td {
    background: #f5f5f5;
}

/* Alert */
.alert {
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.alert.error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #f48fb1;
}

/* Add form inline */
.add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.add-form .field {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0;
}

.add-form .btn-primary {
    width: auto;
    margin-top: 0;
    padding: 10px 24px;
    white-space: nowrap;
}

.empty {
    color: #888;
    text-align: center;
    padding: 20px;
}
