/* ============================================================
   Usskey World - Business Management System
   Color Theme: Dark #1A1A1A | Orange #FF6B00 | Gold #C9A227
   ============================================================ */

/* Reset and Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #121212;
}

.container,
.main-content,
.content-wrapper,
main {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10px 96px;
    box-sizing: border-box;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #1A1A1A 0%, #2a1000 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(255,107,0,0.25);
    border-bottom: 2px solid #FF6B00;
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.main-header nav.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 5px 0.6rem 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    flex-wrap: nowrap;
    gap: 8px;
}

.nav-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    color: #C9A227;
}

.nav-brand .company-info {
    font-size: 0.72rem;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    color: #FF6B00;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2px;
    flex-shrink: 1;
    flex-wrap: nowrap;
    align-items: center;
}

.nav-menu > li {
    position: relative;
}

.nav-menu a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.82rem;
    white-space: nowrap;
    display: block;
}

.nav-menu a:hover {
    background-color: rgba(255,107,0,0.2);
    color: #FF6B00;
}

/* Dropdown */
.nav-dropdown > a::after {
    content: ' ▾';
    font-size: 0.7rem;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e1e1e;
    border: 1px solid #FF6B00;
    border-radius: 6px;
    min-width: 150px;
    box-shadow: 0 4px 16px rgba(255,107,0,0.3);
    z-index: 2000;
    padding: 4px 0;
}

.nav-dropdown-menu a {
    padding: 0.4rem 1rem;
    border-radius: 0;
    font-size: 0.82rem;
    color: #e0e0e0;
}

.nav-dropdown-menu a:hover {
    background: rgba(255,107,0,0.15);
    color: #FF6B00;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 0.78rem;
    white-space: nowrap;
    color: #aaa;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    background: linear-gradient(135deg, #1A1A1A 0%, #2d1200 50%, #FF6B00 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: #1A1A1A;
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(255,107,0,0.35), 0 2px 8px rgba(0,0,0,0.7);
    width: 100%;
    max-width: 420px;
    border: 1.5px solid #FF6B00;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #C9A227;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.login-form h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #FF6B00;
    font-weight: normal;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-form label {
    color: #C9A227 !important;
}

.login-form input {
    background: #2a2a2a !important;
    color: #fff !important;
    border: 1px solid #FF6B00 !important;
}

.login-form input:focus {
    border-color: #C9A227 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(201,162,39,0.25);
}

.login-info {
    margin-top: 2rem;
    padding: 1rem;
    background: #2a2a2a;
    border-radius: 5px;
    font-size: 0.9rem;
    border: 1px solid #333;
}

.login-info p {
    margin: 0.25rem 0;
    color: #aaa;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #FF6B00;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn:hover {
    background: #e05a00;
    transform: translateY(-2px);
}

.login-page .btn-primary {
    background: linear-gradient(90deg, #FF6B00, #C9A227);
    color: #1A1A1A;
    font-weight: 700;
    width: 100%;
    letter-spacing: 1px;
    border: none;
}
.login-page .btn-primary:hover {
    background: linear-gradient(90deg, #C9A227, #FF6B00);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,107,0,0.4);
}

.btn-primary {
    background: #FF6B00;
    color: white;
}
.btn-primary:hover {
    background: #e05a00;
}

.btn-success {
    background: #28a745;
}

.btn-info {
    background: #17a2b8;
}

.btn-warning {
    background: #C9A227;
    color: #1A1A1A;
}

.btn-secondary {
    background: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
}
.btn-secondary:hover {
    background: #444;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* ============================================================
   Forms
   ============================================================ */
.form {
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    border: 1px solid #2e2e2e;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #C9A227;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #3a3a3a;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #2a2a2a;
    color: #e0e0e0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FF6B00;
    box-shadow: 0 0 0 3px rgba(255,107,0,0.15);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Search Form */
.search-form {
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 1px solid #2e2e2e;
}

.search-form .form-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-form select {
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid #3a3a3a;
    border-radius: 5px;
    background: #2a2a2a;
    color: #e0e0e0;
}

.search-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #3a3a3a;
    border-radius: 5px;
    background: #2a2a2a;
    color: #e0e0e0;
}

/* ============================================================
   Tables
   ============================================================ */
.table-container {
    background: #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 1px solid #2e2e2e;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #2e2e2e;
    color: #e0e0e0;
}

.data-table th {
    background: linear-gradient(90deg, #1A1A1A, #2a1000);
    font-weight: 600;
    color: #C9A227;
    border-bottom: 2px solid #FF6B00;
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: rgba(255,107,0,0.07);
}

.text-right {
    text-align: right;
}

/* BY/TO Amount Columns */
.amount-by {
    text-align: right;
    color: #4caf50;
    font-weight: 600;
}

.amount-to {
    text-align: right;
    color: #ef5350;
    font-weight: 600;
}

.amount-by:before {
    content: "Rs. ";
}

.amount-to:before {
    content: "Rs. ";
}

/* Status and Badges */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status.active {
    background: rgba(40,167,69,0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.status.inactive {
    background: rgba(220,53,69,0.2);
    color: #ef5350;
    border: 1px solid #ef5350;
}

.status.completed {
    background: rgba(40,167,69,0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.status.draft {
    background: rgba(201,162,39,0.2);
    color: #C9A227;
    border: 1px solid #C9A227;
}

.status.pending {
    background: rgba(255,107,0,0.2);
    color: #FF6B00;
    border: 1px solid #FF6B00;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-warning {
    background: rgba(201,162,39,0.25);
    color: #C9A227;
}

/* ============================================================
   Dashboard
   ============================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: #FF6B00;
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(255,107,0,0.3);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #2e2e2e;
    border-top: 3px solid #FF6B00;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255,107,0,0.2);
    border-top-color: #C9A227;
}

.stat-card.alert {
    border-top: 5px solid #ef5350;
    border-left: none;
}

.stat-card h3 {
    color: #aaa;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #FF6B00;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(255,107,0,0.4);
}

.stat-amount {
    font-size: 1.2rem;
    color: #4caf50;
    margin-bottom: 1rem;
}

.stat-card a {
    color: #C9A227;
    text-decoration: none;
    font-weight: 500;
}
.stat-card a:hover {
    color: #FF6B00;
}

.quick-actions {
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
    border: 1px solid #2e2e2e;
    border-left: 4px solid #FF6B00;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Recent Transactions Section */
.recent-transactions {
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-top: 2rem;
    border: 1px solid #2e2e2e;
}

.recent-transactions .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.recent-transactions .section-header h2 {
    color: #C9A227;
    font-size: 1.5rem;
}

.transaction-filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.transaction-filter-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: #2a2a2a;
    color: #aaa;
    border: 1px solid #3a3a3a;
}

.transaction-filter-buttons .btn:hover {
    background: #333;
    color: #e0e0e0;
}

.transaction-filter-buttons .btn.active {
    background: #FF6B00;
    color: white;
    border-color: #FF6B00;
}

.transaction-action-buttons {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.transaction-action-buttons .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Transaction List Header */
.transaction-list-header {
    background: linear-gradient(90deg, #1A1A1A, #2a1000);
    border: 1px solid #FF6B00;
    color: white;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.transaction-list-header .header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.transaction-list-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #C9A227;
}

.add-button-inline .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Transaction Cards */
.transaction-card {
    background: #222;
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.transaction-header {
    background: #1A1A1A;
    color: #e0e0e0;
    padding: 0.75rem 1.5rem;
    border-bottom: 2px solid #FF6B00;
}

.transaction-header h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: #FF6B00;
}

.transaction-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #888;
}

.transaction-meta span {
    display: flex;
    gap: 0.25rem;
}

.transaction-card .table-container {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.transaction-card .data-table td.amount,
.recent-transactions .data-table td.amount {
    text-align: right;
    font-weight: 600;
    color: #FF6B00;
}

.transaction-card .data-table .total-row,
.recent-transactions .data-table .total-row {
    background: #1A1A1A;
    font-weight: bold;
    border-top: 2px solid #FF6B00;
    color: #C9A227;
}

.recent-transactions .data-table td.doc-number {
    font-weight: 600;
    color: #FF6B00;
    vertical-align: middle;
    border-right: 2px solid #2e2e2e;
}

.recent-transactions .data-table td[rowspan] {
    vertical-align: middle;
    background: #222;
}

.recent-transactions .data-table .action-cell {
    text-align: center;
    white-space: nowrap;
}

.recent-transactions .data-table .action-cell .btn {
    display: block;
    margin: 0.25rem auto;
    min-width: 60px;
}

.no-data, .no-selection {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.no-data p, .no-selection p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Item Rows for Sales/GRN */
.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #2a2a2a;
    border-radius: 5px;
    border: 1px solid #3a3a3a;
}

.item-row select,
.item-row input {
    padding: 0.5rem;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    background: #1e1e1e;
    color: #e0e0e0;
}

.item-row button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

.low-stock {
    background-color: rgba(239,83,80,0.1);
    border-left: 3px solid #ef5350;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(40,167,69,0.15);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.alert-error {
    background: rgba(220,53,69,0.15);
    color: #ef5350;
    border: 1px solid #ef5350;
}

/* Footer */
.main-footer {
    background: #1A1A1A;
    color: #666;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 2px solid #FF6B00;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #1A1A1A;
}
::-webkit-scrollbar-thumb {
    background: #FF6B00;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #C9A227;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .container {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .item-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .search-form .form-row {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
