:root {
    /* Variables adapted from chrome extension/css/styles.css */
    --dark-grey: #2c2c2c;
    --light-grey: #3a3a3a;
    --black: #000000;
    --white: #ffffff;
    --header-font-size: 36px; /* Slightly smaller for admin */
    --transition-duration: 0.2s;
    --primary-color: #ff5252;
    --box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
    --hover-box-shadow: 6px 6px 0 0 rgba(0, 0, 0, 1);
    --border-radius: 8px; /* Smaller radius */
    --font-family: 'Poppins', sans-serif; /* Using Poppins as fallback */
    
    /* Dark theme colors from extension */
    --bg-color: #1a1a1a;
    --card-bg: #2a2a2a;
    --text-color: #e0e0e0;
    --border-color: #000;
    --secondary-text: #a0a0a0;
    --table-alt-row: #222;
    --table-hover: rgba(52, 152, 219, 0.15);
    --danger-color: #e74c3c;
    --warning-color: #ffc107;
    --success-color: #2ecc71;
}

body {
    box-sizing: border-box;
    font-family: var(--font-family);
    margin: 0;
    padding: 25px;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 1400px; /* Wider container */
    margin: auto;
    background-color: transparent; /* Remove white background */
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Add gap between sections */
}

/* Header styles */
.header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

.logo {
    height: 40px; /* Slightly smaller logo */
    border: 2px solid var(--border-color);
    border-radius: 50%;
    padding: 3px;
    background: var(--primary-color);
    box-shadow: 2px 2px 0 0 var(--black);
}

h1 {
    margin: 0;
    font-size: var(--header-font-size);
    color: var(--text-color);
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

h2 {
    color: var(--text-color);
    border-bottom: 1px solid var(--light-grey);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

button {
    background: var(--primary-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 20px; /* Adjusted padding */
    cursor: pointer;
    margin: 0; /* Remove default margins */
    box-shadow: var(--box-shadow);
    font-family: var(--font-family);
    font-weight: bold;
    transition: all var(--transition-duration) ease;
    display: inline-flex; /* Align icon and text */
    align-items: center;
    gap: 8px; /* Space between icon and text */
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--hover-box-shadow);
    opacity: 0.9;
}

button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

button:disabled {
    background-color: var(--dark-grey);
    color: var(--secondary-text);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.actions {
    margin-bottom: 0;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    box-shadow: var(--box-shadow);
    padding: 15px;
    display: flex;
    gap: 10px;
}

/* Filter Buttons */
.license-filter-buttons {
    margin-bottom: 15px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    box-shadow: var(--box-shadow);
    padding: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Advanced Filters */
.advanced-filters {
    margin-bottom: 15px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    box-shadow: var(--box-shadow);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.advanced-filters .filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.advanced-filters .filters-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.advanced-filters .filters-label {
    color: var(--secondary-text);
    font-weight: 600;
    margin-right: 4px;
}

.advanced-filters input[type="date"] {
    padding: 8px 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--dark-grey);
    color: var(--text-color);
}

@media (max-width: 768px) {
    .advanced-filters {
        padding: 12px;
    }
    .advanced-filters .filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .advanced-filters .filters-group {
        flex-wrap: wrap;
    }
}

/* Desktop filter buttons maintain flex layout */
@media (min-width: 769px) {
    .license-filter-buttons {
        display: flex !important;
        grid-template-columns: unset !important;
        grid-template-rows: unset !important;
    }

    .filter-btn {
        display: inline-flex !important;
        flex-direction: row !important;
        min-height: auto !important;
        padding: 8px 16px !important;
        font-size: 0.9em !important;
    }

    .filter-btn i {
        font-size: 1em !important;
        margin-bottom: 0 !important;
        margin-right: 8px !important;
    }
}

.filter-btn {
    background: var(--light-grey);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 16px;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    font-family: var(--font-family);
    font-weight: bold;
    transition: all var(--transition-duration) ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.filter-btn:hover {
    background: var(--primary-color);
    box-shadow: var(--hover-box-shadow);
    transform: translate(-2px, -2px);
}

.filter-btn.active {
    background: var(--primary-color);
    box-shadow: var(--hover-box-shadow);
    transform: translate(-2px, -2px);
}

.filter-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 1);
}

/* Table Styles */
.table-container {
    margin-top: 0;
    overflow-x: auto;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 10px;
    max-width: 100%;
    /* Force horizontal scrolling when needed */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--dark-grey);
}

/* Custom scrollbar styles for webkit browsers */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--dark-grey);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--light-grey);
}

.table-container h2 {
    margin-top: 0;
}

table {
    min-width: 1520px; /* Increased to accommodate subscription ID column */
    width: 100%;
    border-collapse: separate; /* Use separate for spacing */
    border-spacing: 0;
    margin-top: 10px;
    border: none; /* Remove table border, container has one */
    table-layout: fixed; /* Fixed table layout for better column control */
}

th, td {
    border: 1px solid var(--dark-grey); /* Use dark grey border */
    padding: 8px 6px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8em;
    color: var(--text-color);
}

/* Column widths for better display - using fixed pixel widths */
table th:nth-child(1),
table td:nth-child(1) { /* License Key */
    width: 120px;
    min-width: 120px;
    word-break: break-all;
}

table th:nth-child(2),
table td:nth-child(2) { /* Scraper Type */
    width: 100px;
    min-width: 100px;
    text-align: center;
}

table th:nth-child(3),
table td:nth-child(3) { /* Type */
    width: 80px;
    min-width: 80px;
}

table th:nth-child(4),
table td:nth-child(4) { /* Status */
    width: 80px;
    min-width: 80px;
}

table th:nth-child(5),
table td:nth-child(5) { /* Expires At */
    width: 100px;
    min-width: 100px;
}

table th:nth-child(6),
table td:nth-child(6) { /* Plan Tier */
    width: 90px;
    min-width: 90px;
}

table th:nth-child(7),
table td:nth-child(7) { /* Lead Limit */
    width: 90px;
    min-width: 90px;
}

table th:nth-child(8),
table td:nth-child(8) { /* Usage Count */
    width: 80px;
    min-width: 80px;
}

table th:nth-child(9),
table td:nth-child(9) { /* Period Start */
    width: 100px;
    min-width: 100px;
}

table th:nth-child(10),
table td:nth-child(10) { /* Max Devices */
    width: 80px;
    min-width: 80px;
    text-align: center;
}

table th:nth-child(11),
table td:nth-child(11) { /* Devices Used */
    width: 80px;
    min-width: 80px;
    text-align: center;
}

table th:nth-child(12),
table td:nth-child(12) { /* Pay ID (Dodo Payment ID) */
    width: 110px;
    min-width: 110px;
    word-break: break-all;
}

table th:nth-child(13),
table td:nth-child(13) { /* Subs ID (Subscription ID) */
    width: 110px;
    min-width: 110px;
    word-break: break-all;
}

table th:nth-child(14),
table td:nth-child(14) { /* Cus ID (Dodo Customer ID) */
    width: 110px;
    min-width: 110px;
    word-break: break-all;
}

table th:nth-child(15),
table td:nth-child(15) { /* Pro ID (Dodo Product ID) */
    width: 110px;
    min-width: 110px;
    word-break: break-all;
}

table th:nth-child(16),
table td:nth-child(16) { /* Method (Payment Method) */
    width: 100px;
    min-width: 100px;
}

table th:nth-child(17),
table td:nth-child(17) { /* Note */
    width: 120px;
    min-width: 120px;
    white-space: pre-wrap;
    word-break: break-word;
}

table th:nth-child(18),
table td:nth-child(18) { /* Actions */
    width: 170px;
    min-width: 170px;
    text-align: center;
    white-space: nowrap;
}

th {
    background-color: var(--primary-color);
    color: var(--text-color);
    font-weight: bold;
    text-transform: none;
    letter-spacing: 0.5px;
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
    padding: 10px 8px;
    font-size: 0.75em;
    white-space: nowrap; /* Prevent header text wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Show ellipsis for long headers */
    vertical-align: middle;
    text-align: center;
    line-height: 1.2;
}

tbody tr {
    background-color: var(--card-bg);
    transition: background-color var(--transition-duration) ease;
}

tbody tr:nth-child(even) {
    background-color: var(--table-alt-row);
}

tbody tr:hover {
    background-color: var(--table-hover);
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 6px;
    margin: 2px;
    font-size: 0.9em;
    border-radius: 4px;
    min-width: 30px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.5);
}

.action-btn i {
    margin: 0;
}

.action-btn.reset {
    background-color: var(--warning-color);
    color: var(--black);
}

.action-btn.delete-license {
    background-color: var(--danger-color);
    color: white;
}

/* Form Styles */
.form-container {
    background-color: var(--card-bg);
    padding: 20px 25px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0;
    box-shadow: var(--box-shadow);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: var(--secondary-text);
    font-size: 0.9em;
}

.form-group input[type="text"],
.form-group input[type="email"], /* Style login inputs */
.form-group input[type="password"], /* Style login inputs */
.form-group input[type="date"],
.form-group input[type="number"], /* Style quantity input */
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--dark-grey);
    color: var(--text-color);
    font-family: var(--font-family);
    box-sizing: border-box;
    transition: all var(--transition-duration) ease;
    font-size: 0.95em;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25); /* Focus ring */
}

/* Fix autocomplete styling */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--dark-grey) inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
    border: 2px solid var(--border-color) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--dark-grey) inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
    border: 2px solid var(--primary-color) !important;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.form-actions button[type="button"] {
    background-color: var(--light-grey);
}

.form-actions button[type="button"]:hover {
    background-color: var(--dark-grey);
}

.hidden {
    display: none;
}

.status {
    margin-top: 15px;
    font-size: 0.9em;
    font-style: normal;
    color: var(--secondary-text);
    padding: 8px 10px;
    background-color: var(--dark-grey);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: inline-block; /* Prevent full width */
    min-height: 1.2em;
}

#form-status.error,
#table-status.error,
#login-status.error {
    color: var(--danger-color);
    font-weight: bold;
    border-color: var(--danger-color);
    background-color: rgba(231, 76, 60, 0.1);
}

#form-status.success {
    color: var(--success-color);
    font-weight: bold;
    border-color: var(--success-color);
    background-color: rgba(46, 204, 113, 0.1);
}

/* Auth Styles */
#login-container {
    background-color: var(--card-bg);
    padding: 50px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 550px;
    margin: 0 auto;
}

#login-container h2 {
    text-align: center;
    margin-top: 0;
}

#login-container .form-group input[type="email"],
#login-container .form-group input[type="password"] {
    width: 100%;
    min-width: 500px;
    padding: 12px 15px;
    font-size: 1em;
}

#user-status {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 15px;
    margin-bottom: 0;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
}

#user-status span {
    font-size: 0.95em;
}
#user-status span strong {
    color: var(--primary-color);
}

#logout-btn {
    background-color: var(--light-grey);
    padding: 8px 15px; /* Adjusted padding */
    font-size: 0.9em;
    margin: 0;
}

#logout-btn:hover {
    background-color: var(--dark-grey);
}

/* Hide main content by default */
#main-content.hidden {
    display: none;
}

/* Specific Overrides */
#table-status {
    display: block; /* Make table status block */
    text-align: center;
}

/* --- NEW Inline Editing Styles --- */
td.editable {
    cursor: text; /* Indicate text is editable */
    position: relative; /* Needed for positioning the input */
}

td.editable:hover {
    background-color: rgba(52, 152, 219, 0.2); /* Subtle hover highlight */
}

td.editing {
    padding: 0 !important; /* Remove padding when input is shown */
    cursor: default;
}

td.editing input,
td.editing select {
    width: 100%;
    height: 100%;
    padding: 11px 14px; /* Match cell padding */
    margin: 0;
    border: 2px solid var(--primary-color); /* Highlight editing */
    background-color: var(--light-grey);
    color: var(--text-color);
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
    outline: none;
    border-radius: 0; /* Remove radius within cell */
}

td.editing select {
    appearance: none; /* Minimal appearance for select */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none; /* Remove default arrow */
}

/* Status Spans (for display, need to be hidden during edit) */
.status-active,
.status-inactive {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
}

.status-active {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.status-inactive {
    background-color: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

/* --- End Inline Editing Styles --- */

/* --- NEW Search Styles --- */
.search-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    box-shadow: var(--box-shadow);
    padding: 15px;
    display: flex;
    gap: 10px;
    align-items: center; /* Align items vertically */
    margin-bottom: 15px; /* Add margin below search */
}

.search-container input[type="text"] {
    flex-grow: 1; /* Allow input to take available space */
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--dark-grey);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 0.95em;
    transition: all var(--transition-duration) ease;
}

.search-container input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.search-container button {
    padding: 10px 15px; /* Slightly smaller padding */
}

/* Style for secondary clear button */
.search-container button.secondary {
    background-color: var(--light-grey);
}

.search-container button.secondary:hover {
    background-color: var(--dark-grey);
}
/* --- End Search Styles --- */

/* License row styling for different statuses and plans */
tbody tr.license-active {
    border-left: 4px solid #2ecc71;
}

/* Plan-specific styling */
tbody tr.plan-starter {
    background-color: rgba(52, 152, 219, 0.1);
}

tbody tr.plan-pro {
    background-color: rgba(155, 89, 182, 0.1);
}

tbody tr.plan-Pro-Trial {
    background-color: rgba(241, 196, 15, 0.1);
}

tbody tr.plan-unlimited {
    background-color: rgba(46, 204, 113, 0.1);
}

/* Still apply alternating row styles */
tbody tr:nth-child(even).plan-starter {
    background-color: rgba(52, 152, 219, 0.15);
}

tbody tr:nth-child(even).plan-pro {
    background-color: rgba(155, 89, 182, 0.15);
}

tbody tr:nth-child(even).plan-Pro-Trial {
    background-color: rgba(241, 196, 15, 0.15);
}

tbody tr:nth-child(even).plan-unlimited {
    background-color: rgba(46, 204, 113, 0.15);
}

/* Add a subtle hover effect that preserves the plan color */
tbody tr:hover {
    filter: brightness(1.1);
}

/* --- NEW: Devices Modal Styles --- */
.modal {
    display: block; /* Changed from 'none' to 'block' to make modal visible by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 25px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    max-width: 600px; /* Default max width */
}

.modal-content.wide {
    max-width: 1000px; /* Wider for devices table */
}

.modal-close {
    color: var(--secondary-text);
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-color);
    text-decoration: none;
}

.modal h2 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

#devices-modal h2 span {
    color: var(--primary-color); /* Highlight license key */
    font-size: 0.8em; /* Slightly smaller */
}

#devices-table {
    width: 100%;
    table-layout: fixed;
}

#devices-table th,
#devices-table td {
    white-space: normal; /* Allow wrapping for device info */
    word-break: break-word; /* Break long words */
}

#devices-table th:nth-child(1) { width: 20%; } /* Device ID */
#devices-table th:nth-child(2) { width: 25%; } /* Device Info */
#devices-table th:nth-child(3) { width: 15%; } /* Activated */
#devices-table th:nth-child(4) { width: 15%; } /* Last Seen */
#devices-table th:nth-child(5) { width: 10%; } /* Status */
#devices-table th:nth-child(6) { width: 15%; } /* Action */

#devices-table .action-btn {
    background-color: var(--warning-color); /* Default color */
    color: var(--black);
    padding: 5px 10px;
    margin: 0;
    font-size: 0.85em;
    border-radius: 4px;
    width: 100%; /* Make button full width */
    text-align: center;
}

#devices-table .action-btn.toggle-status[data-is-active="true"] {
    background-color: var(--danger-color); /* Red for deactivate */
    color: white;
}

#devices-table .action-btn.toggle-status[data-is-active="false"] {
    background-color: var(--success-color); /* Green for activate */
    color: white;
}

#devices-table tr.device-inactive td {
    color: var(--secondary-text); /* Dimmed text for inactive devices */
}

/* Style for the active/inactive status indicators */
#devices-table .status-active,
#devices-table .status-inactive {
    display: block;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    text-align: center;
}

#devices-table .status-active {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

#devices-table .status-inactive {
    background-color: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

/* --- End Devices Modal Styles --- */

/* --- Mobile Card View Styles --- */
.licenses-cards {
    display: none; /* Hidden by default, shown on mobile */
}

.license-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

/* Removed left border and plan colors for cleaner mobile view */

.card-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-title {
    flex: 1;
    min-width: 0;
}

.card-key {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.9em;
    word-break: break-all;
    margin-bottom: 5px;
}

.card-status {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.card-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    padding: 5px 8px;
    font-size: 0.7em;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
    transition: all 0.2s ease;
}

.card-toggle:hover {
    background: var(--dark-grey);
    color: var(--text-color);
    transform: none;
    box-shadow: none;
}

.card-body {
    padding: 15px;
    display: none; /* Hidden by default */
}

.card-body.expanded {
    display: block;
}

.card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 15px;
    margin-bottom: 15px;
}

.card-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-label {
    font-size: 0.75em;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 0.85em;
    color: var(--text-color);
    word-break: break-word;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-actions .action-btn {
    flex: 1;
    min-width: 120px;
    height: 40px;
    font-size: 0.8em;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

/* Desktop view adjustments */
@media (min-width: 769px) {
    .licenses-cards {
        display: none !important;
    }
    
    .table-container {
        display: block;
    }
    
    /* Show table view for devices on desktop */
    #devices-table-container {
        display: block !important;
    }
    
    .devices-cards {
        display: none !important;
    }
}

/* --- Enhanced Mobile Responsive Styles --- */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 0;
        gap: 8px;
    }

    /* Header adjustments */
    .header {
        padding: 12px 15px;
        gap: 10px;
        flex-direction: column;
        text-align: center;
    }

    .logo {
        height: 35px;
        align-self: center;
    }

    h1 {
        font-size: 1.4em;
        margin: 5px 0 0 0;
    }

    /* User status bar */
    #user-status {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    #user-status span {
        font-size: 0.9em;
    }

    /* Action bar adjustments - buttons in same line */
    .actions {
        padding: 12px;
        flex-direction: row;
        gap: 8px;
        flex-wrap: wrap;
    }

    .actions button {
        flex: 1;
        min-width: 140px;
        padding: 12px 8px;
        font-size: 0.8em;
    }

    /* Filter buttons adjustments - 3 buttons per row on mobile */
    .license-filter-buttons {
        padding: 12px;
        gap: 8px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }

    .filter-btn {
        padding: 12px 8px;
        font-size: 0.75em;
        text-align: center;
        line-height: 1.3;
        min-height: 45px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .filter-btn i {
        font-size: 1.1em;
        margin-bottom: 2px;
    }

    /* Search container adjustments - buttons in same line */
    .search-container {
        padding: 12px;
        flex-direction: column;
        gap: 8px;
    }

    .search-container input[type="text"] {
        width: 100%;
        padding: 12px;
        font-size: 1em;
        margin-bottom: 8px;
    }

    .search-buttons {
        display: flex;
        gap: 8px;
    }

    .search-container button {
        flex: 1;
        padding: 12px;
        font-size: 0.85em;
    }

    /* Form adjustments */
    .form-container {
        padding: 15px;
        margin: 0 5px;
    }

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

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 1em;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .form-actions button {
        width: 100%;
        padding: 12px;
        font-size: 0.9em;
    }

    /* Login container */
    #login-container {
        padding: 20px;
        margin: 10px 5px;
        max-width: none;
    }

    #login-container .form-group input[type="email"],
    #login-container .form-group input[type="password"] {
        min-width: unset;
        width: 100%;
        padding: 12px;
        font-size: 1em;
    }

    /* Hide table view and show card view on mobile */
    .table-container {
        display: none;
    }

    .licenses-cards {
        display: block;
        background: var(--card-bg);
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        padding: 10px;
    }

    .licenses-cards h2 {
        margin-top: 0;
        margin-bottom: 15px;
    }

    /* Modal adjustments for mobile */
    .modal-content {
        margin: 2% auto;
        padding: 15px;
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content.wide {
        width: 95%;
        max-width: 95%;
    }

    .modal h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
        padding-right: 30px;
    }

    /* Device table in modal - also use cards on mobile */
    #devices-table-container {
        display: none !important;
    }

    .devices-cards {
        display: block !important;
    }

    .device-card {
        background: var(--dark-grey);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        margin-bottom: 10px;
        padding: 12px;
        box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.3);
    }

    .device-card.device-inactive {
        opacity: 0.6;
    }

    .device-info {
        margin-bottom: 10px;
    }

    .device-id {
        font-weight: bold;
        color: var(--primary-color);
        font-size: 0.9em;
        margin-bottom: 5px;
        word-break: break-all;
    }

    .device-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px 10px;
        font-size: 0.8em;
        margin-bottom: 10px;
    }

    .device-action {
        text-align: center;
    }

    .device-action button {
        width: 100%;
        padding: 8px 12px;
        font-size: 0.85em;
    }

    /* Status adjustments */
    .status {
        font-size: 0.85em;
        text-align: center;
        margin: 10px 5px;
    }

    /* Dodo info adjustments */
    .dodo-info-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
/* --- End Responsive Styles --- */

/* Dodo Payment Information Styling */
.dodo-info-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background-color: var(--dark-grey);
    padding: 10px;
    border-radius: var(--border-radius);
    margin-top: 5px;
}

.dodo-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dodo-info-label {
    font-size: 0.8em;
    color: var(--secondary-text);
}

.dodo-info-group label {
    margin-bottom: 0;
} 